diff options
-rw-r--r-- | benchmarks/benchmark.py | 2 | ||||
-rw-r--r-- | doc/sphinxext/docscrape.py | 2 | ||||
-rw-r--r-- | doc/sphinxext/plot_directive.py | 6 | ||||
-rw-r--r-- | pavement.py | 2 | ||||
-rw-r--r-- | tools/osxbuild/build.py | 2 | ||||
-rw-r--r-- | tools/win32build/build.py | 2 | ||||
-rw-r--r-- | tools/win32build/prepare_bootstrap.py | 2 |
7 files changed, 9 insertions, 9 deletions
diff --git a/benchmarks/benchmark.py b/benchmarks/benchmark.py index 526a69d58..047379451 100644 --- a/benchmarks/benchmark.py +++ b/benchmarks/benchmark.py @@ -35,7 +35,7 @@ class Benchmark(dict): try: print "%s: %s" % (modname, \ self.module_test[mod].repeat(self.runs,self.reps)) - except Exception, e: + except Exception as e: print "%s: Failed to benchmark (%s)." % (modname,e) print '-'*79 diff --git a/doc/sphinxext/docscrape.py b/doc/sphinxext/docscrape.py index bbd3fcacc..f2d6d47f1 100644 --- a/doc/sphinxext/docscrape.py +++ b/doc/sphinxext/docscrape.py @@ -428,7 +428,7 @@ class FunctionDoc(NumpyDocString): argspec = inspect.formatargspec(*argspec) argspec = argspec.replace('*','\*') signature = '%s%s' % (func_name, argspec) - except TypeError, e: + except TypeError as e: signature = '%s()' % func_name self['Signature'] = signature diff --git a/doc/sphinxext/plot_directive.py b/doc/sphinxext/plot_directive.py index 80801e798..fad7a76d7 100644 --- a/doc/sphinxext/plot_directive.py +++ b/doc/sphinxext/plot_directive.py @@ -291,7 +291,7 @@ def run(arguments, content, options, state_machine, state, lineno): results = makefig(code, source_file_name, build_dir, output_base, config) errors = [] - except PlotError, err: + except PlotError as err: reporter = state.memo.reporter sm = reporter.system_message( 2, "Exception occurred in plotting %s: %s" % (output_base, err), @@ -458,7 +458,7 @@ def run_code(code, code_path, ns=None): if not ns: exec setup.config.plot_pre_code in ns exec code in ns - except (Exception, SystemExit), err: + except (Exception, SystemExit) as err: raise PlotError(traceback.format_exc()) finally: os.chdir(pwd) @@ -565,7 +565,7 @@ def makefig(code, code_path, output_dir, output_base, config): for format, dpi in formats: try: figman.canvas.figure.savefig(img.filename(format), dpi=dpi) - except exceptions.BaseException, err: + except exceptions.BaseException as err: raise PlotError(traceback.format_exc()) img.formats.append(format) diff --git a/pavement.py b/pavement.py index 09e7a3aa8..b1b9f3367 100644 --- a/pavement.py +++ b/pavement.py @@ -316,7 +316,7 @@ def bootstrap(options): """create virtualenv in ./bootstrap""" try: import virtualenv - except ImportError, e: + except ImportError as e: raise RuntimeError("virtualenv is needed for bootstrap") bdir = options.bootstrap_dir diff --git a/tools/osxbuild/build.py b/tools/osxbuild/build.py index 4c9b8f64c..ef6006fa1 100644 --- a/tools/osxbuild/build.py +++ b/tools/osxbuild/build.py @@ -74,7 +74,7 @@ def shellcmd(cmd, verbose=True): print cmd try: subprocess.check_call(cmd, shell=True) - except subprocess.CalledProcessError, err: + except subprocess.CalledProcessError as err: msg = """ Error while executing a shell command. %s diff --git a/tools/win32build/build.py b/tools/win32build/build.py index b1b592db5..4acb2e879 100644 --- a/tools/win32build/build.py +++ b/tools/win32build/build.py @@ -63,7 +63,7 @@ def build(arch, pyver): subprocess.check_call(cmd, shell = True, stderr = subprocess.STDOUT, stdout = f) finally: f.close() - except subprocess.CalledProcessError, e: + except subprocess.CalledProcessError as e: msg = """ There was an error while executing the following command: diff --git a/tools/win32build/prepare_bootstrap.py b/tools/win32build/prepare_bootstrap.py index 73d1a4b61..f1d8edbfb 100644 --- a/tools/win32build/prepare_bootstrap.py +++ b/tools/win32build/prepare_bootstrap.py @@ -18,7 +18,7 @@ def build_sdist(): os.chdir('../..') cmd = ["python", "setup.py", "sdist", "--format=zip"] subprocess.call(cmd) - except Exception, e: + except Exception as e: raise RuntimeError("Error while executing cmd (%s)" % e) finally: os.chdir(cwd) |