[pypy-commit] pypy default: makeref: Execute from any directory

techtonik noreply at buildbot.pypy.org
Fri Apr 11 11:15:21 CEST 2014


Author: anatoly techtonik <techtonik at gmail.com>
Branch: 
Changeset: r70546:9f856c1374ce
Date: 2014-04-10 13:57 +0300
http://bitbucket.org/pypy/pypy/changeset/9f856c1374ce/

Log:	makeref: Execute from any directory

diff --git a/pypy/doc/tool/makeref.py b/pypy/doc/tool/makeref.py
--- a/pypy/doc/tool/makeref.py
+++ b/pypy/doc/tool/makeref.py
@@ -1,3 +1,12 @@
+
+# patch sys.path so that this script can be executed standalone
+import sys
+from os.path import abspath, dirname
+# this script is assumed to be at pypy/doc/tool/makeref.py
+path = dirname(abspath(__file__))
+path = dirname(dirname(dirname(path)))
+sys.path.insert(0, path)
+
 
 import py
 import pypy


More information about the pypy-commit mailing list