diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-03-19 12:51:48 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-03-19 12:51:48 +0100 |
commit | 4c177fce89fee925f0f4fbfde00ce2e1252562c0 (patch) | |
tree | 3e7a8a8f9771aeb649449b390d1ba5038cc32059 /paste/debug | |
parent | 4450e264ae1d68e0150e0ab9f611118d9797d694 (diff) | |
download | paste-4c177fce89fee925f0f4fbfde00ce2e1252562c0.tar.gz |
Python 3: fix more submodules
* print syntax
* replace "except Exception, exc:" with "except Exception as exc:"
Diffstat (limited to 'paste/debug')
-rwxr-xr-x | paste/debug/doctest_webapp.py | 20 | ||||
-rw-r--r-- | paste/debug/fsdiff.py | 4 | ||||
-rwxr-xr-x | paste/debug/testserver.py | 4 | ||||
-rw-r--r-- | paste/debug/watchthreads.py | 4 |
4 files changed, 16 insertions, 16 deletions
diff --git a/paste/debug/doctest_webapp.py b/paste/debug/doctest_webapp.py index 935b291..f399ac3 100755 --- a/paste/debug/doctest_webapp.py +++ b/paste/debug/doctest_webapp.py @@ -30,7 +30,7 @@ paste_parent = os.path.dirname( def run(command): data = run_raw(command) if data: - print data + print(data) def run_raw(command): """ @@ -56,7 +56,7 @@ def run_command(command, name, and_print=False): show_file('shell-command', name, description='shell transcript', data=data) if and_print and output: - print output + print(output) def _make_env(): env = os.environ.copy() @@ -88,7 +88,7 @@ def ls(dir=None, recurse=False, indent=0): full = os.path.join(dir, fn) if os.path.isdir(full): fn = fn + '/' - print ' '*indent + fn + print(' '*indent + fn) if os.path.isdir(full) and recurse: ls(dir=full, recurse=True, indent=indent+2) @@ -158,13 +158,13 @@ def show(path_info, example_name): expected = f.read() f.close() if not html_matches(expected, result): - print 'Pages did not match. Expected from %s:' % fn - print '-'*60 - print expected - print '='*60 - print 'Actual output:' - print '-'*60 - print result + print('Pages did not match. Expected from %s:' % fn) + print('-'*60) + print(expected) + print('='*60) + print('Actual output:') + print('-'*60) + print(result) def html_matches(pattern, text): regex = re.escape(pattern) diff --git a/paste/debug/fsdiff.py b/paste/debug/fsdiff.py index f680bf6..156a2e4 100644 --- a/paste/debug/fsdiff.py +++ b/paste/debug/fsdiff.py @@ -263,8 +263,8 @@ class File(object): __tracebackhide__ = True bytes = self.bytes if s not in bytes: - print 'Could not find %r in:' % s - print bytes + print('Could not find %r in:' % s) + print(bytes) assert s in bytes def __repr__(self): diff --git a/paste/debug/testserver.py b/paste/debug/testserver.py index 0adeefc..4817161 100755 --- a/paste/debug/testserver.py +++ b/paste/debug/testserver.py @@ -47,7 +47,7 @@ class WSGIRegressionServer(WSGIServer): if now > self.expires and self.timeout: # note regression test doesn't handle exceptions in # threads very well; so we just print and exit - print "\nWARNING: WSGIRegressionServer timeout exceeded\n" + print("\nWARNING: WSGIRegressionServer timeout exceeded\n") break if self.pending: self.handle_request() @@ -62,7 +62,7 @@ class WSGIRegressionServer(WSGIServer): def serve(application, host=None, port=None, handler=None): server = WSGIRegressionServer(application, host, port, handler) - print "serving on %s:%s" % server.server_address + print("serving on %s:%s" % server.server_address) server.serve_forever() return server diff --git a/paste/debug/watchthreads.py b/paste/debug/watchthreads.py index 1048213..c877942 100644 --- a/paste/debug/watchthreads.py +++ b/paste/debug/watchthreads.py @@ -290,7 +290,7 @@ def format_environ(environ): environ_template.substitute( key=cgi.escape(str(key)), value=cgi.escape(str(value)))) - except Exception, e: + except Exception as e: environ_rows.append( environ_template.substitute( key=cgi.escape(str(key)), @@ -339,7 +339,7 @@ def make_bad_app(global_conf, pause=0): else: count = 0 while 1: - print "I'm alive %s (%s)" % (count, thread.get_ident()) + print("I'm alive %s (%s)" % (count, thread.get_ident())) time.sleep(10) count += 1 start_response('200 OK', [('content-type', 'text/plain')]) |