diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-03 21:38:08 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-03 21:39:44 -0500 |
commit | 28ce6807939845e7f3037bdba439c21c5e92fb8d (patch) | |
tree | 6a83d72cf94e5ec30554be46f2a7e67e30821ead /setuptools/_distutils | |
parent | bdba8e773ee2b1557d2d44157e2642f1de8ab139 (diff) | |
parent | 8f2df0bf6f4b4d9a9e3e45e86fa37e8f5fbf0b89 (diff) | |
download | python-setuptools-git-28ce6807939845e7f3037bdba439c21c5e92fb8d.tar.gz |
Merge https://github.com/pypa/distutils at 8f2df0bf6.
Diffstat (limited to 'setuptools/_distutils')
-rw-r--r-- | setuptools/_distutils/command/install.py | 9 | ||||
-rw-r--r-- | setuptools/_distutils/tests/test_unixccompiler.py | 7 |
2 files changed, 13 insertions, 3 deletions
diff --git a/setuptools/_distutils/command/install.py b/setuptools/_distutils/command/install.py index c756b6db..18b352fa 100644 --- a/setuptools/_distutils/command/install.py +++ b/setuptools/_distutils/command/install.py @@ -471,8 +471,13 @@ class install(Command): raise DistutilsOptionError( "must not supply exec-prefix without prefix") - self.prefix = os.path.normpath(sys.prefix) - self.exec_prefix = os.path.normpath(sys.exec_prefix) + # Allow Fedora to add components to the prefix + _prefix_addition = getattr(sysconfig, '_prefix_addition', "") + + self.prefix = ( + os.path.normpath(sys.prefix) + _prefix_addition) + self.exec_prefix = ( + os.path.normpath(sys.exec_prefix) + _prefix_addition) else: if self.exec_prefix is None: diff --git a/setuptools/_distutils/tests/test_unixccompiler.py b/setuptools/_distutils/tests/test_unixccompiler.py index 63c7dd37..2ea93da1 100644 --- a/setuptools/_distutils/tests/test_unixccompiler.py +++ b/setuptools/_distutils/tests/test_unixccompiler.py @@ -11,9 +11,12 @@ from distutils.errors import DistutilsPlatformError from distutils.unixccompiler import UnixCCompiler from distutils.util import _clear_cached_macosx_ver -class UnixCCompilerTestCase(unittest.TestCase): +from . import support + +class UnixCCompilerTestCase(support.TempdirManager, unittest.TestCase): def setUp(self): + super().setUp() self._backup_platform = sys.platform self._backup_get_config_var = sysconfig.get_config_var self._backup_get_config_vars = sysconfig.get_config_vars @@ -23,6 +26,7 @@ class UnixCCompilerTestCase(unittest.TestCase): self.cc = CompilerWrapper() def tearDown(self): + super().tearDown() sys.platform = self._backup_platform sysconfig.get_config_var = self._backup_get_config_var sysconfig.get_config_vars = self._backup_get_config_vars @@ -237,6 +241,7 @@ class UnixCCompilerTestCase(unittest.TestCase): # ensure that setting output_dir does not raise # FileNotFoundError: [Errno 2] No such file or directory: 'a.out' self.cc.output_dir = 'scratch' + os.chdir(self.mkdtemp()) self.cc.has_function('abort', includes=['stdlib.h']) |