diff --git a/pym/calculate/lib/utils/files.py b/pym/calculate/lib/utils/files.py index 9df430c..6fe39af 100644 --- a/pym/calculate/lib/utils/files.py +++ b/pym/calculate/lib/utils/files.py @@ -745,9 +745,9 @@ def pathJoin(*paths): """Складывает пути, в отличии от os.path.join, складывает абсолютные пути""" if len(paths) == 1: return paths[0] - return reduce(path.join, (x for x + return reduce(path.join, [x for x in (y.startswith("/") and y[1:] or y for y - in paths[1:]) if x and x != "/"), paths[0]) + in paths[1:]) if x and x != "/"], paths[0]) def listDirectory(directory, fullPath=False, onlyDir=False): diff --git a/pym/calculate/lib/utils/mount.py b/pym/calculate/lib/utils/mount.py index 06dac9a..66b13a1 100644 --- a/pym/calculate/lib/utils/mount.py +++ b/pym/calculate/lib/utils/mount.py @@ -219,8 +219,8 @@ def childMounts(pathname): return "" with open(mtabFile) as f: return reduce(lambda x, y: x + [y], - (x for x in ([y[0], y[1]] for y in (z.split(" ") for z in f)) - if commonPath(absPath, x[0]) == absPath or commonPath(absPath, x[1]) == absPath), []) + [x for x in ([y[0], y[1]] for y in (z.split(" ") for z in f)) + if commonPath(absPath, x[0]) == absPath or commonPath(absPath, x[1]) == absPath], []) class MountError(Exception): pass