Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee27e9b

Browse files
committed
Py3k: make config command py3k importable.
1 parent a3ac1f3 commit ee27e9b

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

numpy/distutils/command/config.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from numpy.distutils.exec_command import exec_command
1717
from numpy.distutils.mingw32ccompiler import generate_manifest
1818
from numpy.distutils.command.autodist import check_inline, check_compiler_gcc4
19+
from numpy.distutils.compat import get_exception
1920

2021
LANG_EXT['f77'] = '.f'
2122
LANG_EXT['f90'] = '.f90'
@@ -53,7 +54,8 @@ def _check_compiler (self):
5354
if not self.compiler.initialized:
5455
try:
5556
self.compiler.initialize()
56-
except IOError, e:
57+
except IOError:
58+
e = get_exception()
5759
msg = """\
5860
Could not initialize compiler instance: do you have Visual Studio
5961
installed ? If you are trying to build with mingw, please use python setup.py
@@ -63,8 +65,8 @@ def _check_compiler (self):
6365
class was %s
6466
============================================================================""" \
6567
% (e, self.compiler.__class__.__name__)
66-
print """\
67-
============================================================================"""
68+
print ("""\
69+
============================================================================""")
6870
raise distutils.errors.DistutilsPlatformError(msg)
6971

7072
if not isinstance(self.fcompiler, FCompiler):
@@ -85,7 +87,8 @@ def _wrap_method(self,mth,lang,args):
8587
self.compiler = self.fcompiler
8688
try:
8789
ret = mth(*((self,)+args))
88-
except (DistutilsExecError,CompileError),msg:
90+
except (DistutilsExecError,CompileError):
91+
msg = str(get_exception())
8992
self.compiler = save_compiler
9093
raise CompileError
9194
self.compiler = save_compiler
@@ -188,7 +191,7 @@ def check_type(self, type_name, headers=None, include_dirs=None,
188191
self._compile(body % {'type': type_name},
189192
headers, include_dirs, 'c')
190193
st = True
191-
except distutils.errors.CompileError, e:
194+
except distutils.errors.CompileError:
192195
st = False
193196
finally:
194197
self._clean()

0 commit comments

Comments
 (0)