summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Di Gregorio <fog@initd.org>2005-08-23 10:38:36 +0000
committerFederico Di Gregorio <fog@initd.org>2005-08-23 10:38:36 +0000
commit8d3fd21280e2be403ba245a7c5521e5bda8d9ae5 (patch)
tree3c205071bb0b6dfb9aec57234c54747838ea8e9e
parentc123389378cb1261126831363cf41b8124a0622e (diff)
downloadpsycopg2-8d3fd21280e2be403ba245a7c5521e5bda8d9ae5.tar.gz
mingw fixes.
-rw-r--r--ChangeLog3
-rw-r--r--examples/simple.py3
-rw-r--r--setup.py10
3 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e4ee7bf..6ca3243 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2005-08-23 Federico Di Gregorio <fog@debian.org>
+ * setup.py: applied patch from Daniele Varrazzo to avoid segfaults
+ when compiling with migw for Python 2.4.x.
+
* psycopg/adapter_mxdatetime.c (mxdatetime_str): ported code from 1.1.x
to convert mxDateTime object preserving the precision of fractional
seconds.
diff --git a/examples/simple.py b/examples/simple.py
index faad65b..2306be1 100644
--- a/examples/simple.py
+++ b/examples/simple.py
@@ -23,7 +23,8 @@ class SimpleQuoter(object):
def sqlquote(x=None):
return "'bar'"
-import sys, psycopg2
+import sys
+import psycopg2
if len(sys.argv) > 1:
DSN = sys.argv[1]
diff --git a/setup.py b/setup.py
index 58ec949..1f044af 100644
--- a/setup.py
+++ b/setup.py
@@ -104,6 +104,16 @@ class psycopg_build_ext(build_ext):
"""
return self.compiler or get_default_compiler()
+ def build_extensions(self):
+ # Linking against this library causes psycopg2 to crash
+ # on Python >= 2.4. Maybe related to strdup calls, cfr.
+ # http://mail.python.org/pipermail/distutils-sig/2005-April/004433.html
+ if self.get_compiler().compiler_type == "mingw32" \
+ and 'msvcr71' in self.compiler.dll_libraries:
+ self.compiler.dll_libraries.remove('msvcr71')
+
+ build_ext.build_extensions(self)
+
def finalize_win32(self):
"""Finalize build system configuration on win32 platform.