From: Kurt B. Kaiser Date: Thu, 9 Aug 2007 18:00:23 +0000 (+0000) Subject: Fix remaining map() issues. X-Git-Tag: v3.0a1~479 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66aaf74e52d36e455af0b771c2c02f02ab05b387;p=python Fix remaining map() issues. M idlelib/PyShell.py M idlelib/EditorWindow.py M idlelib/rpc.py M idlelib/OutputWindow.py M idlelib/RemoteObjectBrowser.py --- diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index a43929dea6..27ff6e1caf 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -817,8 +817,7 @@ class EditorWindow(object): "Return (width, height, x, y)" geom = self.top.wm_geometry() m = re.match(r"(\d+)x(\d+)\+(-?\d+)\+(-?\d+)", geom) - tuple = (map(int, m.groups())) - return tuple + return list(map(int, m.groups())) def close_event(self, event): self.close() diff --git a/Lib/idlelib/OutputWindow.py b/Lib/idlelib/OutputWindow.py index 7991e1836c..ef155a442e 100644 --- a/Lib/idlelib/OutputWindow.py +++ b/Lib/idlelib/OutputWindow.py @@ -47,8 +47,9 @@ class OutputWindow(EditorWindow): self.text.see(mark) self.text.update() - def writelines(self, l): - map(self.write, l) + def writelines(self, lines): + for line in lines: + self.write(line) def flush(self): pass diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 70c36fc8a4..f8c73ee4fc 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1227,8 +1227,9 @@ class PseudoFile(object): def write(self, s): self.shell.write(s, self.tags) - def writelines(self, l): - map(self.write, l) + def writelines(self, lines): + for line in lines: + self.write(line) def flush(self): pass diff --git a/Lib/idlelib/RemoteObjectBrowser.py b/Lib/idlelib/RemoteObjectBrowser.py index bcb9a2e0e4..bf1fb3bf2a 100644 --- a/Lib/idlelib/RemoteObjectBrowser.py +++ b/Lib/idlelib/RemoteObjectBrowser.py @@ -18,7 +18,7 @@ class WrappedObjectTreeItem: def _GetSubList(self): list = self.__item._GetSubList() - return map(remote_object_tree_item, list) + return list(map(remote_object_tree_item, list)) class StubObjectTreeItem: # Lives in IDLE process diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py index 2f3b56dd44..037f8b7213 100644 --- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -288,7 +288,7 @@ class SocketIO(object): if isinstance(obj, RemoteProxy): return RPCProxy(self, obj.oid) if isinstance(obj, list): - return map(self._proxify, obj) + return list(map(self._proxify, obj)) # XXX Check for other types -- not currently needed return obj