Work around late initialization in distutils._msvccompiler.

This commit is contained in:
Christian Ullrich 2016-01-05 22:47:17 +01:00
parent e80bdc1bfd
commit 6a316f7a51

View File

@ -301,6 +301,8 @@ 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(