aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools')
-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: