mirror of
https://github.com/python/cpython.git
synced 2024-11-25 10:54:51 +08:00
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!)
This commit is contained in:
parent
597bc1d46f
commit
964c074a62
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user