Merge branch 'msvc-2015-fix'

This commit is contained in:
Daniele Varrazzo 2016-03-10 12:12:40 +00:00
commit 82ef9cfadd
2 changed files with 5 additions and 0 deletions

1
NEWS
View File

@ -31,6 +31,7 @@ What's new in psycopg 2.6.2
(:ticket:`#352`). (:ticket:`#352`).
- Fixed `!PersistentConnectionPool` on Python 3 (:ticket:`#348`). - Fixed `!PersistentConnectionPool` on Python 3 (:ticket:`#348`).
- Added support for setuptools/wheel (:ticket:`#370`). - Added support for setuptools/wheel (:ticket:`#370`).
- Fix build on Windows with Python 3.5, VS 2015 (:ticket:`#380`).
- Fixed `!errorcodes.lookup` initialization thread-safety (:ticket:`#382`). - Fixed `!errorcodes.lookup` initialization thread-safety (:ticket:`#382`).

View File

@ -304,6 +304,10 @@ class psycopg_build_ext(build_ext):
except AttributeError: except AttributeError:
ext_path = os.path.join(self.build_lib, ext_path = os.path.join(self.build_lib,
'psycopg2', '_psycopg.pyd') 'psycopg2', '_psycopg.pyd')
# Make sure spawn() will work if compile() was never
# called. https://github.com/psycopg/psycopg2/issues/380
if not self.compiler.initialized:
self.compiler.initialize()
self.compiler.spawn( self.compiler.spawn(
['mt.exe', '-nologo', '-manifest', ['mt.exe', '-nologo', '-manifest',
os.path.join('psycopg', manifest), os.path.join('psycopg', manifest),