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

Skip to content

Commit cf934f7

Browse files
committed
Make build_src and build_clib python3 importable.
1 parent 2b2872b commit cf934f7

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

numpy/distutils/command/build_clib.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@ def build_a_library(self, build_info, lib_name, libraries):
125125

126126
sources = build_info.get('sources')
127127
if sources is None or not is_sequence(sources):
128-
raise DistutilsSetupError, \
129-
("in 'libraries' option (library '%s'), " +
128+
raise DistutilsSetupError(("in 'libraries' option (library '%s'), " +
130129
"'sources' must be present and must be " +
131-
"a list of source filenames") % lib_name
130+
"a list of source filenames") % lib_name)
132131
sources = list(sources)
133132

134133
c_sources, cxx_sources, f_sources, fmodule_sources \
@@ -173,8 +172,8 @@ def build_a_library(self, build_info, lib_name, libraries):
173172

174173
# check availability of Fortran compilers
175174
if (f_sources or fmodule_sources) and fcompiler is None:
176-
raise DistutilsError, "library %s has Fortran sources"\
177-
" but no Fortran compiler found" % (lib_name)
175+
raise DistutilsError("library %s has Fortran sources"\
176+
" but no Fortran compiler found" % (lib_name))
178177

179178
macros = build_info.get('macros')
180179
include_dirs = build_info.get('include_dirs')

numpy/distutils/command/build_src.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ def generate_a_pyrex_source(self, base, ext_name, source, extension):
481481
pyrex_result = Pyrex.Compiler.Main.compile(source,
482482
options=options)
483483
if pyrex_result.num_errors != 0:
484-
raise DistutilsError,"%d errors while compiling %r with Pyrex" \
485-
% (pyrex_result.num_errors, source)
484+
raise DistutilsError("%d errors while compiling %r with Pyrex" \
485+
% (pyrex_result.num_errors, source))
486486
elif os.path.isfile(target_file):
487487
log.warn("Pyrex required for compiling %r but not available,"\
488488
" using old target %r"\

0 commit comments

Comments
 (0)