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

Skip to content

Commit b3f8643

Browse files
committed
Fix print/repr/raise python3 incompatibilities in system_info and build_ext command.
1 parent 271cfcf commit b3f8643

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

numpy/distutils/command/build_ext.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def run(self):
101101
if libname in clibs and clibs[libname] != build_info:
102102
log.warn('library %r defined more than once,'\
103103
' overwriting build_info\n%s... \nwith\n%s...' \
104-
% (libname, `clibs[libname]`[:300], `build_info`[:300]))
104+
% (libname, repr(clibs[libname])[:300], repr(build_info)[:300]))
105105
clibs[libname] = build_info
106106
# .. and distribution libraries:
107107
for libname,build_info in self.distribution.libraries or []:
@@ -303,11 +303,11 @@ def build_extension(self, ext):
303303

304304
# check for the availability of required compilers
305305
if cxx_sources and cxx_compiler is None:
306-
raise DistutilsError, "extension %r has C++ sources" \
307-
"but no C++ compiler found" % (ext.name)
306+
raise DistutilsError("extension %r has C++ sources" \
307+
"but no C++ compiler found" % (ext.name))
308308
if (f_sources or fmodule_sources) and fcompiler is None:
309-
raise DistutilsError, "extension %r has Fortran sources " \
310-
"but no Fortran compiler found" % (ext.name)
309+
raise DistutilsError("extension %r has Fortran sources " \
310+
"but no Fortran compiler found" % (ext.name))
311311
if ext.language in ['f77','f90'] and fcompiler is None:
312312
self.warn("extension %r has Fortran libraries " \
313313
"but no Fortran linker found, using default linker" % (ext.name))

numpy/distutils/system_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def get_info(self,notfound_action=0):
451451
if notfound_action==1:
452452
warnings.warn(self.notfounderror.__doc__)
453453
elif notfound_action==2:
454-
raise self.notfounderror,self.notfounderror.__doc__
454+
raise self.notfounderror(self.notfounderror.__doc__)
455455
else:
456456
raise ValueError(repr(notfound_action))
457457

0 commit comments

Comments
 (0)