From: Stefan Behnel Date: Fri, 22 Oct 2010 12:04:27 +0000 (+0200) Subject: code cleanup X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c1fc77d52db352729209df74607e7909e7942bfa;p=cython.git code cleanup --- diff --git a/Cython/Compiler/Dependencies.py b/Cython/Compiler/Dependencies.py index 8b6a55f5..b9747c3a 100644 --- a/Cython/Compiler/Dependencies.py +++ b/Cython/Compiler/Dependencies.py @@ -274,7 +274,7 @@ class DependencyTree(object): 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) @@ -291,9 +291,9 @@ class DependencyTree(object): 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) @@ -392,7 +392,7 @@ def create_extension_list(patterns, ctx=None, aliases=None): 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 == '*': @@ -428,7 +428,7 @@ def cythonize(module_list, ctx=None, nthreads=0, aliases=None): 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: @@ -441,7 +441,7 @@ def cythonize(module_list, ctx=None, nthreads=0, aliases=None): 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) @@ -454,9 +454,9 @@ cython_py = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../cytho 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:]) diff --git a/Cython/Distutils/build_ext.py b/Cython/Distutils/build_ext.py index 397f0972..b7895a02 100644 --- a/Cython/Distutils/build_ext.py +++ b/Cython/Distutils/build_ext.py @@ -3,7 +3,7 @@ Implements a version of the Distutils 'build_ext' command, for building Cython extension modules.""" -# This module should be kept compatible with Python 2.1. +# This module should be kept compatible with Python 2.3. __revision__ = "$Id:$"