diff --git a/gunicorn/util.py b/gunicorn/util.py index 7aa93b55..b2496bab 100644 --- a/gunicorn/util.py +++ b/gunicorn/util.py @@ -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