Skip to content
Snippets Groups Projects
Commit 81b32804 authored by Manuel Günther's avatar Manuel Günther
Browse files

Hopefully fixed bug in python 2.6

parent e8d79335
No related branches found
No related tags found
No related merge requests found
......@@ -94,12 +94,17 @@ def zipfile_readlines(package, filename):
import zipfile
with zipfile.ZipFile(package) as f:
f = None
try:
f = zipfile.ZipFile(package)
try:
package_dir = os.path.splitext(os.path.basename(package))[0]
return [line.decode('utf-8') if isinstance(line, bytes) else line for line in f.open(os.path.join(package_dir, filename), 'rU').readlines()]
except:
pass
finally:
if f is not None:
f.close()
return []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment