summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2003-02-06 16:22:01 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2003-02-06 16:22:01 (GMT)
commit656d4519b5a002d716ae2081d126a060fcb12581 (patch)
tree5aade61f57ea35c185cb76f21dbb603eca55efcb
parent26507dbc82e60d4eda8f6b447c50aecf07b7ca25 (diff)
downloadcpython-656d4519b5a002d716ae2081d126a060fcb12581.zip
cpython-656d4519b5a002d716ae2081d126a060fcb12581.tar.gz
cpython-656d4519b5a002d716ae2081d126a060fcb12581.tar.bz2
Replace hasattr() + getattr() with single getattr() and default value.
-rw-r--r--Lib/pickle.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 35ab91b..876c81b 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -943,8 +943,7 @@ def whichmodule(func, funcname):
if module is None:
continue # skip dummy package entries
if name != '__main__' and \
- hasattr(module, funcname) and \
- getattr(module, funcname) is func:
+ getattr(module, funcname, None) is func:
break
else:
name = '__main__'