Replace all map(None, a) with list(a).

This commit is contained in:
Georg Brandl 2008-07-18 19:06:13 +00:00
parent e2886fd3ca
commit 74bbc79d10
5 changed files with 7 additions and 7 deletions

View file

@ -134,7 +134,7 @@ def fillAppsMenu():
file_m_apps.add('command')
file_m_apps.delete(0, 'last')
names = root.winfo_interps()
names = map(None, names) # convert tuple to list
names = list(names)
names.sort()
for name in names:
try:

View file

@ -68,7 +68,7 @@ def maketrans(fromstr, tostr):
raise ValueError, "maketrans arguments must have same length"
global _idmapL
if not _idmapL:
_idmapL = map(None, _idmap)
_idmapL = list(_idmap)
L = _idmapL[:]
fromstr = map(ord, fromstr)
for i in range(len(fromstr)):

View file

@ -391,7 +391,7 @@ def maketrans(fromstr, tostr):
raise ValueError, "maketrans arguments must have same length"
global _idmapL
if not _idmapL:
_idmapL = map(None, _idmap)
_idmapL = list(_idmap)
L = _idmapL[:]
fromstr = map(ord, fromstr)
for i in range(len(fromstr)):

View file

@ -57,7 +57,7 @@ class GroupDatabaseTestCase(unittest.TestCase):
namei = 0
fakename = allnames[namei]
while fakename in bynames:
chars = map(None, fakename)
chars = list(fakename)
for i in xrange(len(chars)):
if chars[i] == 'z':
chars[i] = 'A'
@ -74,7 +74,7 @@ class GroupDatabaseTestCase(unittest.TestCase):
except IndexError:
# should never happen... if so, just forget it
break
fakename = ''.join(map(None, chars))
fakename = ''.join(chars)
self.assertRaises(KeyError, grp.getgrnam, fakename)

View file

@ -62,7 +62,7 @@ class PwdTest(unittest.TestCase):
namei = 0
fakename = allnames[namei]
while fakename in bynames:
chars = map(None, fakename)
chars = list(fakename)
for i in xrange(len(chars)):
if chars[i] == 'z':
chars[i] = 'A'
@ -79,7 +79,7 @@ class PwdTest(unittest.TestCase):
except IndexError:
# should never happen... if so, just forget it
break
fakename = ''.join(map(None, chars))
fakename = ''.join(chars)
self.assertRaises(KeyError, pwd.getpwnam, fakename)