Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 964c074

Browse files
committed
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!)
1 parent 597bc1d commit 964c074

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Doc/tools/mkhowto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ import sys
4646
import tempfile
4747

4848

49+
if not hasattr(os.path, "abspath"):
50+
def abspath(path):
51+
"""Return an absolute path."""
52+
if not os.path.isabs(path):
53+
path = os.path.join(os.getcwd(), path)
54+
return os.path.normpath(path)
55+
56+
os.path.abspath = abspath
57+
58+
4959
MYDIR = os.path.abspath(sys.path[0])
5060
TOPDIR = os.path.dirname(MYDIR)
5161

0 commit comments

Comments
 (0)