summaryrefslogtreecommitdiff
blob: aab130c545000360bf112804f8188a02d2b5d120 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Index: psycopg2-2.7.3/setup.py
===================================================================
--- psycopg2-2.7.3.orig/setup.py
+++ psycopg2-2.7.3/setup.py
@@ -527,20 +527,21 @@ have_pydatetime = True
 have_mxdatetime = False
 use_pydatetime = int(parser.get('build_ext', 'use_pydatetime'))
 
-# check for mx package
-mxincludedir = ''
-if parser.has_option('build_ext', 'mx_include_dir'):
-    mxincludedir = parser.get('build_ext', 'mx_include_dir')
-if not mxincludedir:
-    mxincludedir = os.path.join(get_python_inc(plat_specific=1), "mx")
-if mxincludedir.strip() and os.path.exists(mxincludedir):
-    # Build the support for mx: we will check at runtime if it can be imported
-    include_dirs.append(mxincludedir)
-    define_macros.append(('HAVE_MXDATETIME', '1'))
-    sources.append('adapter_mxdatetime.c')
-    depends.extend(['adapter_mxdatetime.h', 'typecast_mxdatetime.c'])
-    have_mxdatetime = True
-    version_flags.append('mx')
+if not use_pydatetime:
+    # check for mx package
+    mxincludedir = ''
+    if parser.has_option('build_ext', 'mx_include_dir'):
+        mxincludedir = parser.get('build_ext', 'mx_include_dir')
+    if not mxincludedir:
+        mxincludedir = os.path.join(get_python_inc(plat_specific=1), "mx")
+    if mxincludedir.strip() and os.path.exists(mxincludedir):
+        # Build the support for mx: we will check at runtime if it can be imported
+        include_dirs.append(mxincludedir)
+        define_macros.append(('HAVE_MXDATETIME', '1'))
+        sources.append('adapter_mxdatetime.c')
+        depends.extend(['adapter_mxdatetime.h', 'typecast_mxdatetime.c'])
+        have_mxdatetime = True
+        version_flags.append('mx')
 
 # now decide which package will be the default for date/time typecasts
 if have_pydatetime and (use_pydatetime or not have_mxdatetime):