Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9d757c

Browse files
committed
Correct the removal of -Wstrict-prototypes from compiler flags.
Trying to remove the invalid flag in run() was too early (.compiler is still None at that point so we would just always get a (silenced) AttributeError -- catching the AttributeError is necessary to make things work on Windows). Indeed, the Py3.5 build currently displays a lot of warnings about -Wstrict-prototypes. Doing the removal in build_extensions() instead works. This went unnoticed because the upstream issue in distutils (https://bugs.python.org/issue5755) was recently fixed in Py3.6.6 and 3.7.0; but this still affects Py3.5 and Py3.6.{0-5}.
1 parent 10ffa53 commit f9d757c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,16 @@ def __init__(self, dist):
107107

108108

109109
class BuildExtraLibraries(BuildExtCommand):
110-
def run(self):
111-
# Remove the -Wstrict-prototypes option, it's not valid for C++.
110+
def build_extensions(self):
111+
# Remove the -Wstrict-prototypes option, it's not valid for C++. Fixed
112+
# in Py3.7 as bpo-5755.
112113
try:
113114
self.compiler.compiler_so.remove('-Wstrict-prototypes')
114115
except (ValueError, AttributeError):
115116
pass
116117
for package in good_packages:
117118
package.do_custom_build()
118-
return BuildExtCommand.run(self)
119+
return super().build_extensions()
119120

120121

121122
cmdclass = versioneer.get_cmdclass()

0 commit comments

Comments
 (0)