Skip to content

Commit

Permalink
Use absolute path in build_meta_legacy
Browse files Browse the repository at this point in the history
Using the absolute path to the directory of the setup script better
mimics the semantics of a direct invocation of python setup.py.
  • Loading branch information
pganssle committed Jan 28, 2019
1 parent f1bb8db commit 7ce2484
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions setuptools/build_meta_legacy.py
Expand Up @@ -28,10 +28,11 @@ def run_setup(self, setup_script='setup.py'):
# '' 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:
Expand Down

0 comments on commit 7ce2484

Please sign in to comment.