summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-05-29 16:10:07 (GMT)
committerFred Drake <fdrake@acm.org>2001-05-29 16:10:07 (GMT)
commit964c074a627cad21f072e9651067b8b120e3b3f7 (patch)
treeee1f3d2c10b3c9bad63b5a1cd4b47409d6a2a00e /Doc
parent597bc1d46fa1313c12bde0f7292e580bd5807b71 (diff)
downloadcpython-964c074a627cad21f072e9651067b8b120e3b3f7.zip
cpython-964c074a627cad21f072e9651067b8b120e3b3f7.tar.gz
cpython-964c074a627cad21f072e9651067b8b120e3b3f7.tar.bz2
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!)
Diffstat (limited to 'Doc')
-rwxr-xr-xDoc/tools/mkhowto10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/tools/mkhowto b/Doc/tools/mkhowto
index 6481e93..f92cbda 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)