From 731dc2a3ef2af32585febe97b7843d133c82000e Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 14 Jan 2014 21:56:36 +0000 Subject: [PATCH] Fixed debug build on Windows Patches on master by James Emerton, from github pull request #8. Conflicts: NEWS --- NEWS | 1 + setup.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 89230551..cc1633bc 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ What's new in psycopg 2.4.7 Alexey Borzenkov (:ticket:`#173`). - Manually creating `lobject` with the wrong parameter doesn't segfault (:ticket:`#187`). + - Fixed debug build on Windows, thanks to James Emerton. What's new in psycopg 2.4.6 diff --git a/setup.py b/setup.py index 0bb486dc..0abc51eb 100644 --- a/setup.py +++ b/setup.py @@ -287,12 +287,15 @@ class psycopg_build_ext(build_ext): manifest = '_psycopg.vc9.x86.manifest' if platform == 'win-amd64': manifest = '_psycopg.vc9.amd64.manifest' + try: + ext_path = self.get_ext_fullpath(extension.name) + except AttributeError: + ext_path = os.path.join(self.build_lib, + 'psycopg2', '_psycopg.pyd') self.compiler.spawn( ['mt.exe', '-nologo', '-manifest', os.path.join('psycopg', manifest), - '-outputresource:%s;2' % ( - os.path.join(self.build_lib, - 'psycopg2', '_psycopg.pyd'))]) + '-outputresource:%s;2' % ext_path]) def finalize_win32(self): """Finalize build system configuration on win32 platform."""