Mercurial > p > roundup > code
changeset 5434:1ab2c81a64df
Python 3 preparation: avoid string.join().
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Wed, 25 Jul 2018 10:43:40 +0000 |
| parents | 86b6cea7a975 |
| children | 12baa5b9b597 |
| files | frontends/roundup.cgi roundup/cgi/apache.py roundup/cgi/cgitb.py |
| diffstat | 3 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/frontends/roundup.cgi Wed Jul 25 10:42:42 2018 +0000 +++ b/frontends/roundup.cgi Wed Jul 25 10:43:40 2018 +0000 @@ -140,14 +140,14 @@ # Main CGI handler # def main(out, err): - import os, string + import os import roundup.instance path = os.environ.get('PATH_INFO', '/').split('/') request = RequestWrapper(out) request.path = os.environ.get('PATH_INFO', '/') tracker = path[1] os.environ['TRACKER_NAME'] = tracker - os.environ['PATH_INFO'] = string.join(path[2:], '/') + os.environ['PATH_INFO'] = '/'.join(path[2:]) if tracker in TRACKER_HOMES: # redirect if we need a trailing '/' if len(path) == 2:
--- a/roundup/cgi/apache.py Wed Jul 25 10:42:42 2018 +0000 +++ b/roundup/cgi/apache.py Wed Jul 25 10:43:40 2018 +0000 @@ -123,7 +123,7 @@ _env = dict(req.subprocess_env) # XXX classname must be the first item in PATH_INFO. roundup.cgi does: # path = os.environ.get('PATH_INFO', '/').split('/') - # os.environ['PATH_INFO'] = string.join(path[2:], '/') + # os.environ['PATH_INFO'] = '/'.join(path[2:]) # we just remove the first character ('/') _env["PATH_INFO"] = req.path_info[1:] if _timing:
--- a/roundup/cgi/cgitb.py Wed Jul 25 10:42:42 2018 +0000 +++ b/roundup/cgi/cgitb.py Wed Jul 25 10:43:40 2018 +0000 @@ -7,7 +7,7 @@ from __future__ import print_function __docformat__ = 'restructuredtext' -import sys, os, string, keyword, linecache, tokenize, inspect, cgi +import sys, os, keyword, linecache, tokenize, inspect, cgi import pydoc, traceback from roundup.cgi import templating, TranslationService @@ -180,7 +180,7 @@ name = '<em>global</em> <strong>%s</strong>' % name lvals.append('%s = %s'%(name, value)) if lvals: - lvals = string.join(lvals, ', ') + lvals = ', '.join(lvals) lvals = indent + '<small><font color="#909090">%s'\ '</font></small><br>'%lvals else: @@ -200,7 +200,7 @@ if i == lnum: excerpt.append(lvals) i = i + 1 - traceback.append('<p>' + level + string.join(excerpt, '\n')) + traceback.append('<p>' + level + '\n'.join(excerpt)) traceback.reverse() @@ -210,7 +210,7 @@ value = pydoc.html.repr(getattr(evalue, name)) attribs.append('<br>%s%s = %s' % (indent, name, value)) - return head + string.join(attribs) + string.join(traceback) + '<p> </p>' + return head + ' '.join(attribs) + ' '.join(traceback) + '<p> </p>' def handler(): print(breaker())
