def find_pxd(self, module, filename=None):
if module[0] == '.':
- raise NotImplementedError, "New relative imports."
+ raise NotImplementedError("New relative imports.")
if filename is not None:
relative = '.'.join(self.package(filename) + tuple(module.split('.')))
pxd = self.context.find_pxd_file(relative, None)
a = self.cimports(filename)
b = filter(None, [self.find_pxd(m, filename) for m in self.cimports(filename)])
if len(a) != len(b):
- print (filename)
- print ("\n\t".join(a))
- print ("\n\t".join(b))
+ print(filename)
+ print("\n\t".join(a))
+ print("\n\t".join(b))
return tuple(self_pxd + filter(None, [self.find_pxd(m, filename) for m in self.cimports(filename)]))
cimported_files = cached_method(cimported_files)
base = DistutilsInfo(template)
exn_type = type(template)
else:
- raise TypeError, pattern
+ raise TypeError(pattern)
for file in glob(filepattern):
pkg = deps.package(file)
if name == '*':
dep_timestamp, dep = deps.newest_dependency(source)
priority = 2 - (dep in deps.immediate_dependencies(source))
if c_timestamp < dep_timestamp:
- print "Compiling", source, "because it depends on", dep
+ print("Compiling %s because it depends on %s" % (source, dep))
to_compile.append((priority, source, c_file))
new_sources.append(c_file)
else:
try:
import multiprocessing
except ImportError:
- print "multiprocessing required for parallel cythonization"
+ print("multiprocessing required for parallel cythonization")
nthreads = 0
pool = multiprocessing.Pool(nthreads)
pool.map(cythonoize_one_helper, to_compile)
def cythonoize_one(pyx_file, c_file):
cmd = "%s %s %s -o %s" % (sys.executable, cython_py, pyx_file, c_file)
- print cmd
+ print(cmd)
if os.system(cmd) != 0:
- raise CompilerError, pyx_file
+ raise CompilerError(pyx_file)
def cythonoize_one_helper(m):
return cythonoize_one(*m[1:])