Skip to content

Commit

Permalink
Merge pull request #207 from dalcinl/main
Browse files Browse the repository at this point in the history
[BUG] Fix accumulating flags after compile/link

Fixes pypa/setuptools@3591.
  • Loading branch information
jaraco authored Feb 13, 2024
2 parents dcd70ba + e649e93 commit e651e53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions distutils/ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def _fix_compile_args(self, output_dir, macros, include_dirs):
raise TypeError("'output_dir' must be a string or None")

if macros is None:
macros = self.macros
macros = list(self.macros)
elif isinstance(macros, list):
macros = macros + (self.macros or [])
else:
Expand Down Expand Up @@ -442,14 +442,14 @@ def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
fixed versions of all arguments.
"""
if libraries is None:
libraries = self.libraries
libraries = list(self.libraries)
elif isinstance(libraries, (list, tuple)):
libraries = list(libraries) + (self.libraries or [])
else:
raise TypeError("'libraries' (if supplied) must be a list of strings")

if library_dirs is None:
library_dirs = self.library_dirs
library_dirs = list(self.library_dirs)
elif isinstance(library_dirs, (list, tuple)):
library_dirs = list(library_dirs) + (self.library_dirs or [])
else:
Expand All @@ -459,7 +459,7 @@ def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
library_dirs += self.__class__.library_dirs

if runtime_library_dirs is None:
runtime_library_dirs = self.runtime_library_dirs
runtime_library_dirs = list(self.runtime_library_dirs)
elif isinstance(runtime_library_dirs, (list, tuple)):
runtime_library_dirs = list(runtime_library_dirs) + (
self.runtime_library_dirs or []
Expand Down

0 comments on commit e651e53

Please sign in to comment.