Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 4, 2021
2 parents bdba8e7 + 8f2df0b commit 28ce680
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/2914.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Merge with pypa/distutils@8f2df0bf6.
9 changes: 7 additions & 2 deletions setuptools/_distutils/command/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,13 @@ def finalize_unix(self):
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:
Expand Down
7 changes: 6 additions & 1 deletion setuptools/_distutils/tests/test_unixccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
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
Expand All @@ -23,6 +26,7 @@ def rpath_foo(self):
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
Expand Down Expand Up @@ -237,6 +241,7 @@ def test_has_function(self):
# 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'])


Expand Down

0 comments on commit 28ce680

Please sign in to comment.