Skip to content

Commit 1217b85

Browse files
committed
Python 3 preparation: avoid string.split().
1 parent 3466ed4 commit 1217b85

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

frontends/roundup.cgi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ except:
8686
# Check environment for config items
8787
#
8888
def checkconfig():
89-
import os, string
89+
import os
9090
global TRACKER_HOMES, LOG
9191

9292
# see if there's an environment var. ROUNDUP_INSTANCE_HOMES is the
@@ -97,9 +97,9 @@ def checkconfig():
9797
homes = os.environ.get('TRACKER_HOMES', '')
9898
if homes:
9999
TRACKER_HOMES = {}
100-
for home in string.split(homes, os.pathsep):
100+
for home in homes.split(os.pathsep):
101101
try:
102-
name, dir = string.split(home, '=', 1)
102+
name, dir = home.split('=', 1)
103103
except ValueError:
104104
# ignore invalid definitions
105105
continue
@@ -142,7 +142,7 @@ class RequestWrapper:
142142
def main(out, err):
143143
import os, string
144144
import roundup.instance
145-
path = string.split(os.environ.get('PATH_INFO', '/'), '/')
145+
path = os.environ.get('PATH_INFO', '/').split('/')
146146
request = RequestWrapper(out)
147147
request.path = os.environ.get('PATH_INFO', '/')
148148
tracker = path[1]

roundup/cgi/apache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def handler(req):
122122
req.add_common_vars()
123123
_env = dict(req.subprocess_env)
124124
# XXX classname must be the first item in PATH_INFO. roundup.cgi does:
125-
# path = string.split(os.environ.get('PATH_INFO', '/'), '/')
125+
# path = os.environ.get('PATH_INFO', '/').split('/')
126126
# os.environ['PATH_INFO'] = string.join(path[2:], '/')
127127
# we just remove the first character ('/')
128128
_env["PATH_INFO"] = req.path_info[1:]

roundup/cgi/cgitb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def html(context=5, i18n=None):
112112
etype, evalue = sys.exc_info()[0], sys.exc_info()[1]
113113
if type(etype) is type:
114114
etype = etype.__name__
115-
pyver = 'Python ' + string.split(sys.version)[0] + '<br>' + sys.executable
115+
pyver = 'Python ' + sys.version.split()[0] + '<br>' + sys.executable
116116
head = pydoc.html.heading(
117117
_('<font size=+1><strong>%(exc_type)s</strong>: %(exc_value)s</font>')
118118
% {'exc_type': etype, 'exc_value': evalue},

roundup/mailgw.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class node. Any parts of other types are each stored in separate files
9595
from __future__ import print_function
9696
__docformat__ = 'restructuredtext'
9797

98-
import string, re, os, mimetools, smtplib, socket, binascii, quopri
98+
import re, os, mimetools, smtplib, socket, binascii, quopri
9999
import time, random, sys, logging
100100
import codecs
101101
import traceback
@@ -1555,7 +1555,7 @@ def handle_Message(self, message):
15551555
except MailUsageHelp:
15561556
# bounce the message back to the sender with the usage message
15571557
self.logger.debug("MailUsageHelp raised, bouncing.")
1558-
fulldoc = '\n'.join(string.split(__doc__, '\n')[2:])
1558+
fulldoc = '\n'.join(__doc__.split('\n')[2:])
15591559
m = ['']
15601560
m.append('\n\nMail Gateway Help\n=================')
15611561
m.append(fulldoc)
@@ -1564,7 +1564,7 @@ def handle_Message(self, message):
15641564
except MailUsageError as value:
15651565
# bounce the message back to the sender with the usage message
15661566
self.logger.debug("MailUsageError raised, bouncing.")
1567-
fulldoc = '\n'.join(string.split(__doc__, '\n')[2:])
1567+
fulldoc = '\n'.join(__doc__.split('\n')[2:])
15681568
m = ['']
15691569
m.append(str(value))
15701570
m.append('\n\nMail Gateway Help\n=================')
@@ -1719,7 +1719,7 @@ def setPropArrayFromString(self, cl, propString, nodeid=None):
17191719
'''
17201720
props = {}
17211721
errors = []
1722-
for prop in string.split(propString, ';'):
1722+
for prop in propString.split(';'):
17231723
# extract the property name and value
17241724
try:
17251725
propname, value = prop.split('=')

0 commit comments

Comments
 (0)