summaryrefslogtreecommitdiff
path: root/numpy/distutils/mingw32ccompiler.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-12-03 15:55:59 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-12-03 15:55:59 +0000
commit271cfcfaa6ffaeea21aa5ea3bc3673f56886e3d1 (patch)
tree0c5b15e2c839bf11e3b82d9ec35d55683cf732f0 /numpy/distutils/mingw32ccompiler.py
parentee27e9b6dbbfd8a0fce1cb638053efcbdc22eb3f (diff)
downloadnumpy-271cfcfaa6ffaeea21aa5ea3bc3673f56886e3d1.tar.gz
Py3k: make mingw32compiler module py3k importable.
Diffstat (limited to 'numpy/distutils/mingw32ccompiler.py')
-rw-r--r--numpy/distutils/mingw32ccompiler.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py
index d14f487ac..ebc9c0e2b 100644
--- a/numpy/distutils/mingw32ccompiler.py
+++ b/numpy/distutils/mingw32ccompiler.py
@@ -11,13 +11,16 @@ Support code for building Python extensions on Windows.
import os
import subprocess
import sys
-import log
import subprocess
import re
# Overwrite certain distutils.ccompiler functions:
import numpy.distutils.ccompiler
+if sys.version_info[0] < 3:
+ import log
+else:
+ from numpy.distutils import log
# NT stuff
# 1. Make sure libpython<version>.a exists for gcc. If not, build it.
# 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
@@ -192,9 +195,9 @@ class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler):
base = base[1:]
if ext not in (self.src_extensions + ['.rc','.res']):
- raise UnknownFileError, \
+ raise UnknownFileError(
"unknown file type '%s' (from '%s')" % \
- (ext, src_name)
+ (ext, src_name))
if strip_dir:
base = os.path.basename (base)
if ext == '.res' or ext == '.rc':
@@ -212,7 +215,7 @@ class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler):
def find_python_dll():
maj, min, micro = [int(i) for i in sys.version_info[:3]]
dllname = 'python%d%d.dll' % (maj, min)
- print "Looking for %s" % dllname
+ print ("Looking for %s" % dllname)
# We can't do much here:
# - find it in python main dir
@@ -433,10 +436,10 @@ def check_embedded_msvcr_match_linked(msver):
if msvcv:
maj = int(msvcv[5:6])
if not maj == int(msver):
- raise ValueError, \
+ raise ValueError(
"Discrepancy between linked msvcr " \
"(%d) and the one about to be embedded " \
- "(%d)" % (int(msver), maj)
+ "(%d)" % (int(msver), maj))
def configtest_name(config):
base = os.path.basename(config._gen_temp_sourcefile("yo", [], "c"))