* haksizlik etmeyelim, yamuk bir reduce'u da duzeltmistik removepathprefix'de

This commit is contained in:
Eray Özkural
2005-06-24 15:28:27 +00:00
parent f82bc09632
commit cda1ce9d17
+2 -1
View File
@@ -74,10 +74,11 @@ def commonprefix(l):
# but this one is necessary # but this one is necessary
def subpath(a, b): def subpath(a, b):
"""find if path a is before b in the directory tree""" "find if path a is before b in the directory tree"
return prefix(os.path.split(a), os.path.split(b)) return prefix(os.path.split(a), os.path.split(b))
def removepathprefix(a, b): def removepathprefix(a, b):
"remove path prefix a from p, finding the pathname rooted at a"
comps = remove_prefix(os.path.split(a), os.path.split(b)) comps = remove_prefix(os.path.split(a), os.path.split(b))
if len(comps) > 0: if len(comps) > 0:
return os.path.join(*tuple(comps)) return os.path.join(*tuple(comps))