shouldn't be here.

This commit is contained in:
benoitc 2012-02-19 22:11:39 +01:00
parent fd3fae1afd
commit 8e185d38d0

View File

@ -349,24 +349,3 @@ def check_is_writeable(path):
except IOError, e:
raise RuntimeError("Error: '%s' isn't writable [%r]" % (path, e))
f.close()
if not hasattr(os.path, 'relpath'):
def relpath(path, start=os.path.curdir):
"""Return a relative version of a path"""
if not path:
raise ValueError("no path specified")
start_list = os.path.abspath(start).split(os.path.sep)
path_list = os.path.abspath(path).split(os.path.sep)
# Work out how much of the filepath is shared by start and path.
i = len(os.path.commonprefix([start_list, path_list]))
rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
if not rel_list:
return os.path.curdir
return os.path.join(*rel_list)
else:
relpath = os.path.relpath