diff --git a/NEWS b/NEWS index bed7013b..20acb25f 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ What's new in psycopg 2.6.2 (:ticket:`#352`). - Fixed `!PersistentConnectionPool` on Python 3 (:ticket:`#348`). - 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`). diff --git a/setup.py b/setup.py index f83e8e39..8c7437d6 100644 --- a/setup.py +++ b/setup.py @@ -304,6 +304,10 @@ class psycopg_build_ext(build_ext): except AttributeError: ext_path = os.path.join(self.build_lib, '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( ['mt.exe', '-nologo', '-manifest', os.path.join('psycopg', manifest),