summaryrefslogtreecommitdiff
path: root/paste/evalexception
diff options
context:
space:
mode:
authorCyril Roelandt <cyril.roelandt@enovance.com>2014-03-18 12:47:35 +0100
committerCyril Roelandt <cyril.roelandt@enovance.com>2014-03-18 12:47:35 +0100
commitfbd07d8a7cf88daf5d821601578d2f7bc1c92928 (patch)
tree85154672d76bd72b10b6277a5189e1b6587ae11a /paste/evalexception
parent674ae7718bc06a8b8c8b658075bf82c8198fb632 (diff)
downloadpaste-fbd07d8a7cf88daf5d821601578d2f7bc1c92928.tar.gz
Python 3: Replace "except Exception, exc" with "except Exception as exc:"
Diffstat (limited to 'paste/evalexception')
-rw-r--r--paste/evalexception/middleware.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/paste/evalexception/middleware.py b/paste/evalexception/middleware.py
index a31d7e1..455758a 100644
--- a/paste/evalexception/middleware.py
+++ b/paste/evalexception/middleware.py
@@ -146,7 +146,7 @@ def get_debug_info(func):
% debugcount)
debug_info = self.debug_infos[debugcount]
return func(self, debug_info=debug_info, **form)
- except ValueError, e:
+ except ValueError as e:
form['headers']['status'] = '500 Server Error'
return '<html>There was an error: %s</html>' % html_quote(e)
return debug_info_replacement
@@ -457,8 +457,8 @@ def make_table(items):
out = StringIO()
try:
pprint.pprint(value, out)
- except Exception, e:
- print >> out, 'Error: %s' % e
+ except Exception as e:
+ print('Error: %s' % e, file=out)
value = html_quote(out.getvalue())
if len(value) > 100:
# @@: This can actually break the HTML :(