Mercurial > p > roundup > code
comparison roundup/cgi/cgitb.py @ 5376:64b05e24dbd8
Python 3 preparation: convert print to a function.
Tool-assisted patch. It is possible that some "from __future__ import
print_function" are not in fact needed, if a file only uses print()
with a single string as an argument and so would work fine in Python 2
without that import.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 09:54:52 +0000 |
| parents | 6e3e4f24c753 |
| children | 7172c201dec2 |
comparison
equal
deleted
inserted
replaced
| 5375:1ad46057ae4a | 5376:64b05e24dbd8 |
|---|---|
| 2 # This module was written by Ka-Ping Yee, <ping@lfw.org>. | 2 # This module was written by Ka-Ping Yee, <ping@lfw.org>. |
| 3 # | 3 # |
| 4 | 4 |
| 5 """Extended CGI traceback handler by Ka-Ping Yee, <ping@lfw.org>. | 5 """Extended CGI traceback handler by Ka-Ping Yee, <ping@lfw.org>. |
| 6 """ | 6 """ |
| 7 from __future__ import print_function | |
| 7 __docformat__ = 'restructuredtext' | 8 __docformat__ = 'restructuredtext' |
| 8 | 9 |
| 9 import sys, os, types, string, keyword, linecache, tokenize, inspect, cgi | 10 import sys, os, types, string, keyword, linecache, tokenize, inspect, cgi |
| 10 import pydoc, traceback | 11 import pydoc, traceback |
| 11 | 12 |
| 211 attribs.append('<br>%s%s = %s' % (indent, name, value)) | 212 attribs.append('<br>%s%s = %s' % (indent, name, value)) |
| 212 | 213 |
| 213 return head + string.join(attribs) + string.join(traceback) + '<p> </p>' | 214 return head + string.join(attribs) + string.join(traceback) + '<p> </p>' |
| 214 | 215 |
| 215 def handler(): | 216 def handler(): |
| 216 print breaker() | 217 print(breaker()) |
| 217 print html() | 218 print(html()) |
| 218 | 219 |
| 219 # vim: set filetype=python ts=4 sw=4 et si : | 220 # vim: set filetype=python ts=4 sw=4 et si : |
