Commit c5848c0c authored by Stefan Behnel's avatar Stefan Behnel

always use relative file names when loading utility code

parent 48409561
...@@ -231,12 +231,11 @@ class UtilityCodeBase(object): ...@@ -231,12 +231,11 @@ class UtilityCodeBase(object):
loader = __loader__ loader = __loader__
archive = loader.archive archive = loader.archive
with closing(zipfile.ZipFile(archive)) as fileobj: with closing(zipfile.ZipFile(archive)) as fileobj:
listing = [ os.path.basename(name) listing = [os.path.basename(name)
for name in fileobj.namelist() for name in fileobj.namelist()
if os.path.join(archive, name).startswith(utility_dir)] if os.path.join(archive, name).startswith(utility_dir)]
files = [ os.path.join(utility_dir, filename) files = [filename for filename in listing
for filename in listing if filename.startswith(prefix)]
if filename.startswith(prefix) ]
if not files: if not files:
raise ValueError("No match found for utility code " + util_code_name) raise ValueError("No match found for utility code " + util_code_name)
if len(files) > 1: if len(files) > 1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment