summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Ganssle <paul@ganssle.io>2019-01-28 09:25:03 -0500
committerPaul Ganssle <paul@ganssle.io>2019-02-03 12:25:06 -0500
commitdb590baf81ebcb23605da54118905437412228ce (patch)
treec5d9902bc642e35e1c51fe946f2578b2b35ffefe
parent49d17725a0ad02552babbdc79c737cfb27430f4f (diff)
downloadpython-setuptools-git-db590baf81ebcb23605da54118905437412228ce.tar.gz
Use absolute path in build_meta_legacy
Using the absolute path to the directory of the setup script better mimics the semantics of a direct invocation of python setup.py.
-rw-r--r--setuptools/build_meta_legacy.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/setuptools/build_meta_legacy.py b/setuptools/build_meta_legacy.py
index 03492da9..3d209711 100644
--- a/setuptools/build_meta_legacy.py
+++ b/setuptools/build_meta_legacy.py
@@ -28,10 +28,11 @@ class _BuildMetaLegacyBackend(_BuildMetaBackend):
# '' into sys.path. (pypa/setuptools#1642)
sys_path = list(sys.path) # Save the original path
- try:
- if '' not in sys.path:
- sys.path.insert(0, '')
+ script_dir = os.path.dirname(os.path.abspath(setup_script))
+ if script_dir not in sys.path:
+ sys.path.insert(0, script_dir)
+ try:
super(_BuildMetaLegacyBackend,
self).run_setup(setup_script=setup_script)
finally: