diff options
author | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-03-18 12:47:35 +0100 |
---|---|---|
committer | Cyril Roelandt <cyril.roelandt@enovance.com> | 2014-03-18 12:47:35 +0100 |
commit | fbd07d8a7cf88daf5d821601578d2f7bc1c92928 (patch) | |
tree | 85154672d76bd72b10b6277a5189e1b6587ae11a /paste/util | |
parent | 674ae7718bc06a8b8c8b658075bf82c8198fb632 (diff) | |
download | paste-fbd07d8a7cf88daf5d821601578d2f7bc1c92928.tar.gz |
Python 3: Replace "except Exception, exc" with "except Exception as exc:"
Diffstat (limited to 'paste/util')
-rw-r--r-- | paste/util/PySourceColor.py | 2 | ||||
-rw-r--r-- | paste/util/import_string.py | 4 | ||||
-rw-r--r-- | paste/util/scgiserver.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/paste/util/PySourceColor.py b/paste/util/PySourceColor.py index d9f451f..64c0f56 100644 --- a/paste/util/PySourceColor.py +++ b/paste/util/PySourceColor.py @@ -1311,7 +1311,7 @@ class Parser(object): # Parse the source and write out the results.
try:
tokenize.tokenize(text.readline, self)
- except tokenize.TokenError, ex:
+ except tokenize.TokenError as ex:
msg = ex[0]
line = ex[1][0]
self.out.write("<h3>ERROR: %s</h3>%s\n"%
diff --git a/paste/util/import_string.py b/paste/util/import_string.py index 3feb4dd..a10db18 100644 --- a/paste/util/import_string.py +++ b/paste/util/import_string.py @@ -47,7 +47,7 @@ def simple_import(s): try: module = import_module(name) parts = parts[1:] - except ImportError, e: + except ImportError as e: last_import_error = e break obj = module @@ -79,7 +79,7 @@ def try_import_module(module_name): """ try: return import_module(module_name) - except ImportError, e: + except ImportError as e: if not getattr(e, 'args', None): raise desc = e.args[0] diff --git a/paste/util/scgiserver.py b/paste/util/scgiserver.py index d20c952..7963ed6 100644 --- a/paste/util/scgiserver.py +++ b/paste/util/scgiserver.py @@ -131,7 +131,7 @@ class SWAP(scgi_server.SCGIHandler): input.close() output.close() conn.close() - except IOError, err: + except IOError as err: debug("IOError while closing connection ignored: %s" % err) |