From 7dfb40ce437a9fe046a362d55ce052ff559c46a8 Mon Sep 17 00:00:00 2001 From: Jason Erickson Date: Mon, 14 Feb 2011 16:03:38 -0700 Subject: [PATCH 1/2] Windows manifest check now checks compiler type Initial compiler check was only checking two python versions. Changed the check not to check python version, but compiler version, to be compatible with more versions of python. --- setup.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 8edb936f..24d5c232 100644 --- a/setup.py +++ b/setup.py @@ -56,6 +56,10 @@ from distutils.sysconfig import get_python_inc from distutils.ccompiler import get_default_compiler from distutils.dep_util import newer_group from distutils.util import get_platform +try: + from distutils.msvc9compiler import MSVCCompiler +except ImportError: + MSVCCompiler = None try: from distutils.command.build_py import build_py_2to3 as build_py except ImportError: @@ -154,11 +158,9 @@ class psycopg_build_ext(build_ext): def build_extension(self, ext): build_ext.build_extension(self, ext) - # For MSVC compiler and Python 2.6/2.7 (aka VS 2008), re-insert the - # Manifest into the resulting .pyd file. - sysVer = sys.version_info[:2] - if self.get_compiler().lower().startswith('msvc') and \ - sysVer in ((2,6), (2,7)): + # For Python versions that use MSVC compiler 2008, re-insert the + # manifest into the resulting .pyd file. + if MSVCCompiler and isinstance(self.compiler, MSVCCompiler): platform = get_platform() # Default to the x86 manifest manifest = '_psycopg.vc9.x86.manifest' From 7c9d8192a367dd5056b17cc91d5095973b4c7088 Mon Sep 17 00:00:00 2001 From: Jason Erickson Date: Mon, 14 Feb 2011 16:31:31 -0700 Subject: [PATCH 2/2] Increase timeout on concurrent_execution test With test_concurrent_execution test, checking two threads issuing a pg_sleep of 2 seconds and and check if they complete in under 3 seconds occasionally fails when the test is run in a virtual machine on a VM Server with other virtual machines running. Increased the sleep to 4, and the check to 7, giving 3 seconds buffer instead of 1 second. --- tests/test_connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index 616ff289..219c0938 100755 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -119,7 +119,7 @@ class ConnectionTests(unittest.TestCase): def slave(): cnn = psycopg2.connect(dsn) cur = cnn.cursor() - cur.execute("select pg_sleep(2)") + cur.execute("select pg_sleep(3)") cur.close() cnn.close() @@ -130,7 +130,7 @@ class ConnectionTests(unittest.TestCase): t2.start() t1.join() t2.join() - self.assert_(time.time() - t0 < 3, + self.assert_(time.time() - t0 < 5, "something broken in concurrency") def test_encoding_name(self):