diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2003-02-06 16:22:01 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2003-02-06 16:22:01 (GMT) |
commit | 656d4519b5a002d716ae2081d126a060fcb12581 (patch) | |
tree | 5aade61f57ea35c185cb76f21dbb603eca55efcb /Lib/pickle.py | |
parent | 26507dbc82e60d4eda8f6b447c50aecf07b7ca25 (diff) | |
download | cpython-656d4519b5a002d716ae2081d126a060fcb12581.zip cpython-656d4519b5a002d716ae2081d126a060fcb12581.tar.gz cpython-656d4519b5a002d716ae2081d126a060fcb12581.tar.bz2 |
Replace hasattr() + getattr() with single getattr() and default value.
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r-- | Lib/pickle.py | 3 |
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__' |