Skip to content
Snippets Groups Projects
Commit 620ec005 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Correct regression in loadscript

parent fa0c5866
No related branches found
No related tags found
No related merge requests found
......@@ -160,7 +160,7 @@ class FileCache:
os.chmod(f.name, 0o700)
return f
def loadfile(self, path, *name):
def loadfile(self, path, *name, mode=None):
if not path in self.loader:
# Create loader for new path
up = urlparse(path)
......@@ -187,6 +187,8 @@ class FileCache:
u.close()
f.close()
os.utime(f.name, (mtime, mtime))
if mode != None:
os.chmod(f.name, 0o700)
self.cache[key] = CacheEntry(f.name, key)
pass
pass
......@@ -244,10 +246,7 @@ expand_mirror = _cache.expand_mirror
atexit.register(_cache.cleanup)
def loadscript(path, *name):
result = loadfile(path, *name)
if result.filename in temp:
os.chmod(result.filename, 0o700)
return result
return loadfile(path, *name, mode=0o700)
def localpath(prefix, *path):
return os.path.normpath('/'.join(filter(None, [prefix] + list(path))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment