Commit 656d4519 authored by Jeremy Hylton's avatar Jeremy Hylton

Replace hasattr() + getattr() with single getattr() and default value.

parent 26507dbc
......@@ -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__'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment