From: Fred Drake Date: Tue, 29 May 2001 16:10:07 +0000 (+0000) Subject: Hack to make this play nicer with *old* versions of Python: os.path.abspath() X-Git-Tag: v2.2a3~1652 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=964c074a627cad21f072e9651067b8b120e3b3f7;p=thirdparty%2FPython%2Fcpython.git Hack to make this play nicer with *old* versions of Python: os.path.abspath() was not available in Python 1.5.1. (Yes, a user actually tried to use this with that version of Python!) --- diff --git a/Doc/tools/mkhowto b/Doc/tools/mkhowto index 6481e93e2bb5..f92cbda1aae4 100755 --- a/Doc/tools/mkhowto +++ b/Doc/tools/mkhowto @@ -46,6 +46,16 @@ import sys import tempfile +if not hasattr(os.path, "abspath"): + def abspath(path): + """Return an absolute path.""" + if not os.path.isabs(path): + path = os.path.join(os.getcwd(), path) + return os.path.normpath(path) + + os.path.abspath = abspath + + MYDIR = os.path.abspath(sys.path[0]) TOPDIR = os.path.dirname(MYDIR)