Skip to content

Commit c40ce70

Browse files
committed
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.
1 parent d72cebe commit c40ce70

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

setuptools/build_meta_legacy.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ def run_setup(self, setup_script='setup.py'):
2828
# '' into sys.path. (pypa/setuptools#1642)
2929
sys_path = list(sys.path) # Save the original path
3030

31-
try:
32-
if '' not in sys.path:
33-
sys.path.insert(0, '')
31+
script_dir = os.path.dirname(os.path.abspath(setup_script))
32+
if script_dir not in sys.path:
33+
sys.path.insert(0, script_dir)
3434

35+
try:
3536
super(_BuildMetaLegacyBackend,
3637
self).run_setup(setup_script=setup_script)
3738
finally:

0 commit comments

Comments
 (0)