From e80bdc1bfd844c3645dae0c019db5ce311dbce78 Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Tue, 15 Dec 2015 20:55:43 +0100 Subject: [PATCH 1/2] Work around late initialization in distutils._msvccompiler. This fixes Github issue #380. --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 2de8c5ef..9870af84 100644 --- a/setup.py +++ b/setup.py @@ -301,6 +301,8 @@ class psycopg_build_ext(build_ext): except AttributeError: ext_path = os.path.join(self.build_lib, 'psycopg2', '_psycopg.pyd') + if not self.compiler.initialized: + self.compiler.initialize() self.compiler.spawn( ['mt.exe', '-nologo', '-manifest', os.path.join('psycopg', manifest), From 6a316f7a51a694c9029ca79d46847a70bebe3a12 Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Tue, 5 Jan 2016 22:47:17 +0100 Subject: [PATCH 2/2] Work around late initialization in distutils._msvccompiler. --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 9870af84..7b94d0d8 100644 --- a/setup.py +++ b/setup.py @@ -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(