GIF89a;
0 and comps[i-1] not in ('', '..'): del comps[i-1:i+1] i = i - 1 elif comps[i] == '' and i > 0 and comps[i-1] != '': del comps[i] else: i = i + 1 # If the path is now empty, substitute '.' if not prefix and not comps: comps.append('.') return prefix + '/'.join(comps) # Return an absolute path. def abspath(path): """Return the absolute version of a path""" if not isabs(path): if isinstance(path, unicode): cwd = os.getcwdu() else: cwd = os.getcwd() path = join(cwd, path) return normpath(path) # realpath is a no-op on systems without islink support realpath = abspath supports_unicode_filenames = False