From 7ce24840e31dbe8e3283089174be08412d104580 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Mon, 28 Jan 2019 09:25:03 -0500 Subject: [PATCH] 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. --- setuptools/build_meta_legacy.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setuptools/build_meta_legacy.py b/setuptools/build_meta_legacy.py index 03492da9b59..3d209711fe9 100644 --- a/setuptools/build_meta_legacy.py +++ b/setuptools/build_meta_legacy.py @@ -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: