From 74bbc79d10862727c9126f4f8d8868c021a389e4 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 18 Jul 2008 19:06:13 +0000 Subject: Replace all map(None, a) with list(a). --- Demo/tkinter/guido/rmt.py | 2 +- Lib/string.py | 2 +- Lib/stringold.py | 2 +- Lib/test/test_grp.py | 4 ++-- Lib/test/test_pwd.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Demo/tkinter/guido/rmt.py b/Demo/tkinter/guido/rmt.py index 440650c..bfea195 100755 --- a/Demo/tkinter/guido/rmt.py +++ b/Demo/tkinter/guido/rmt.py @@ -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: diff --git a/Lib/string.py b/Lib/string.py index eb680c2..daf9863 100644 --- a/Lib/string.py +++ b/Lib/string.py @@ -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)): diff --git a/Lib/stringold.py b/Lib/stringold.py index 7cbd7aa..ebfe383 100644 --- a/Lib/stringold.py +++ b/Lib/stringold.py @@ -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)): diff --git a/Lib/test/test_grp.py b/Lib/test/test_grp.py index a8dcb63..564c7f0 100755 --- a/Lib/test/test_grp.py +++ b/Lib/test/test_grp.py @@ -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) diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py index 74ce947..255a34c 100644 --- a/Lib/test/test_pwd.py +++ b/Lib/test/test_pwd.py @@ -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) -- cgit v0.12