mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Windows manifest check now checks compiler type
Initial compiler check was only checking two python versions. Changed the check not to check python version, but compiler version, to be compatible with more versions of python.
This commit is contained in:
parent
3842026bed
commit
7dfb40ce43
12
setup.py
12
setup.py
|
@ -56,6 +56,10 @@ from distutils.sysconfig import get_python_inc
|
|||
from distutils.ccompiler import get_default_compiler
|
||||
from distutils.dep_util import newer_group
|
||||
from distutils.util import get_platform
|
||||
try:
|
||||
from distutils.msvc9compiler import MSVCCompiler
|
||||
except ImportError:
|
||||
MSVCCompiler = None
|
||||
try:
|
||||
from distutils.command.build_py import build_py_2to3 as build_py
|
||||
except ImportError:
|
||||
|
@ -154,11 +158,9 @@ class psycopg_build_ext(build_ext):
|
|||
def build_extension(self, ext):
|
||||
build_ext.build_extension(self, ext)
|
||||
|
||||
# For MSVC compiler and Python 2.6/2.7 (aka VS 2008), re-insert the
|
||||
# Manifest into the resulting .pyd file.
|
||||
sysVer = sys.version_info[:2]
|
||||
if self.get_compiler().lower().startswith('msvc') and \
|
||||
sysVer in ((2,6), (2,7)):
|
||||
# For Python versions that use MSVC compiler 2008, re-insert the
|
||||
# manifest into the resulting .pyd file.
|
||||
if MSVCCompiler and isinstance(self.compiler, MSVCCompiler):
|
||||
platform = get_platform()
|
||||
# Default to the x86 manifest
|
||||
manifest = '_psycopg.vc9.x86.manifest'
|
||||
|
|
Loading…
Reference in New Issue
Block a user