From b6d1fbdfd15e00aab08cb2a5e60327d7fd6271a2 Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Wed, 6 Jan 2016 15:04:33 +0100 Subject: [PATCH] Work around late initialization in distutils._msvccompiler. --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) 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),