Commit 20f74518 authored by Éric Araujo's avatar Éric Araujo

Cleanup: use sys.version_info instead of convoluted hexversion lshifts

parent 3bdfb183
...@@ -606,8 +606,7 @@ class build_ext(Command): ...@@ -606,8 +606,7 @@ class build_ext(Command):
template = "python%d%d" template = "python%d%d"
if self.debug: if self.debug:
template = template + '_d' template = template + '_d'
pythonlib = (template % pythonlib = template % sys.version_info[:2]
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
# don't extend ext.libraries, it may be shared with other # don't extend ext.libraries, it may be shared with other
# extensions, it is a reference to the original list # extensions, it is a reference to the original list
return ext.libraries + [pythonlib] return ext.libraries + [pythonlib]
...@@ -621,22 +620,19 @@ class build_ext(Command): ...@@ -621,22 +620,19 @@ class build_ext(Command):
# not at this time - AIM Apr01 # not at this time - AIM Apr01
#if self.debug: #if self.debug:
# template = template + '_d' # template = template + '_d'
pythonlib = (template % pythonlib = template % sys.version_info[:2]
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
# don't extend ext.libraries, it may be shared with other # don't extend ext.libraries, it may be shared with other
# extensions, it is a reference to the original list # extensions, it is a reference to the original list
return ext.libraries + [pythonlib] return ext.libraries + [pythonlib]
elif sys.platform[:6] == "cygwin": elif sys.platform[:6] == "cygwin":
template = "python%d.%d" template = "python%d.%d"
pythonlib = (template % pythonlib = template % sys.version_info[:2]
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
# don't extend ext.libraries, it may be shared with other # don't extend ext.libraries, it may be shared with other
# extensions, it is a reference to the original list # extensions, it is a reference to the original list
return ext.libraries + [pythonlib] return ext.libraries + [pythonlib]
elif sys.platform[:6] == "atheos": elif sys.platform[:6] == "atheos":
template = "python%d.%d" template = "python%d.%d"
pythonlib = (template % pythonlib = template % sys.version_info[:2]
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
# Get SHLIBS from Makefile # Get SHLIBS from Makefile
extra = [] extra = []
for lib in sysconfig.get_config_var('SHLIBS').split(): for lib in sysconfig.get_config_var('SHLIBS').split():
...@@ -654,9 +650,8 @@ class build_ext(Command): ...@@ -654,9 +650,8 @@ class build_ext(Command):
else: else:
if sysconfig.get_config_var('Py_ENABLE_SHARED'): if sysconfig.get_config_var('Py_ENABLE_SHARED'):
pythonlib = 'python{}.{}{}'.format( template = 'python%d%d' + sys.abiflags
sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff, pythonlib = template % sys.version_info[:2]
sys.abiflags)
return ext.libraries + [pythonlib] return ext.libraries + [pythonlib]
else: else:
return ext.libraries return ext.libraries
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment