s/unicode/not bytes/

This commit is contained in:
j 2016-08-30 21:18:57 +02:00
commit 2a312940b3

View file

@ -93,7 +93,7 @@ def parse_path(client, path, prefix=None):
return: return:
return None if file will not be used, dict with parsed item information otherwise return None if file will not be used, dict with parsed item information otherwise
''' '''
if not isinstance(path, unicode): if isinstance(path, bytes):
path = path.decode('utf-8') path = path.decode('utf-8')
path = path.replace(os.sep, '/') path = path.replace(os.sep, '/')
parts = path.split('/') parts = path.split('/')
@ -1075,7 +1075,7 @@ class API(ox.API):
resume_offset = 0 resume_offset = 0
chunk = f.read(CHUNK_SIZE) chunk = f.read(CHUNK_SIZE)
fname = os.path.basename(filename) fname = os.path.basename(filename)
if isinstance(fname, unicode): if not isinstance(fname, bytes):
fname = fname.encode('utf-8') fname = fname.encode('utf-8')
while chunk: while chunk:
elapsed = time.mktime(time.localtime()) - start elapsed = time.mktime(time.localtime()) - start