Skip to content

Commit

Permalink
Fix accumulating flags after compile/link
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcinl authored Feb 28, 2023
1 parent 4435cec commit e649e93
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 @@ -382,7 +382,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 @@ -441,14 +441,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 @@ -458,7 +458,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 e649e93

Please sign in to comment.