rVal = {}
for x in hashes:
if x not in hashfunc_map:
- raise portage.exception.DigestException, x+" hash function not available (needs dev-python/pycrypto or >=dev-lang/python-2.5)"
+ raise portage.exception.DigestException(x+" hash function not available (needs dev-python/pycrypto or >=dev-lang/python-2.5)")
rVal[x] = perform_checksum(filename, x, calc_prelink)[0]
return rVal
if myval:
mydata[x] = " ".join(myval.split())
- if not mydata.setdefault('EAPI', u'0'):
- mydata['EAPI'] = u'0'
+ if not mydata.setdefault('EAPI', _unicode_decode('0')):
+ mydata['EAPI'] = _unicode_decode('0')
if cache_me:
aux_cache = self._aux_cache_slot_dict()
for x in self._aux_cache_keys:
- aux_cache[x] = mydata.get(x, u'')
+ aux_cache[x] = mydata.get(x, _unicode_decode(''))
self._aux_cache[mycpv] = aux_cache
- return [mydata.get(x, u'') for x in wants]
+ return [mydata.get(x, _unicode_decode('')) for x in wants]
def aux_update(self, cpv, values):
if not self.bintree.populated:
if not mydata['SLOT']:
# Empty slot triggers InvalidAtom exceptions when generating slot
# atoms for packages, so translate it to '0' here.
- mydata['SLOT'] = u'0'
+ mydata['SLOT'] = _unicode_decode('0')
return [mydata[x] for x in wants]
def _aux_get(self, mycpv, wants, st=None):
if self._aux_multi_line_re.match(x) is None:
myd = " ".join(myd.split())
except IOError:
- myd = u''
+ myd = _unicode_decode('')
if x == "EAPI" and not myd:
- results.append(u'0')
+ results.append(_unicode_decode('0'))
else:
results.append(myd)
return results
t.connect(username=username, password=password)
conn = paramiko.SFTPClient.from_transport(t)
else:
- raise NotImplementedError, _("%s is not a supported protocol.") % protocol
+ raise NotImplementedError(_("%s is not a supported protocol.") % protocol)
return (conn,protocol,address, http_params, http_headers)
exc_info = sys.exc_info()
if exc_info is not None:
- raise exc_info[0], exc_info[1], exc_info[2]
+ if sys.hexversion >= 0x3000000:
+ raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
+ else:
+ exec("raise exc_info[0], exc_info[1], exc_info[2]")
atexit.register(run_exitfuncs)
for x in mylines:
#the split/join thing removes leading and trailing whitespace, and converts any whitespace in the line
#into single spaces.
- myline = u' '.join(x.split())
+ myline = _unicode_decode(' ').join(x.split())
if not len(myline):
continue
if myline[0]=="#":