summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-07-29 15:38:23 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-07-29 15:38:23 (GMT)
commitc473f8ceac03338657cb30314b4b1c8733b17ac9 (patch)
tree40c4a0a2a91119013a44ef3e76d9247cae5a1292 /Lib/pydoc.py
parent947fed42b8f1eb6c1b7cc9dec4e51db589d76bd8 (diff)
parente64e51bfa78cd8ec046e187a3214cd9d477fc65c (diff)
downloadcpython-c473f8ceac03338657cb30314b4b1c8733b17ac9.zip
cpython-c473f8ceac03338657cb30314b4b1c8733b17ac9.tar.gz
cpython-c473f8ceac03338657cb30314b4b1c8733b17ac9.tar.bz2
Merge fix for #8887 from 3.2
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index ebd8a61..f0b0200 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1479,13 +1479,14 @@ def locate(path, forceload=0):
else: break
if module:
object = module
- for part in parts[n:]:
- try: object = getattr(object, part)
- except AttributeError: return None
- return object
else:
- if hasattr(builtins, path):
- return getattr(builtins, path)
+ object = builtins
+ for part in parts[n:]:
+ try:
+ object = getattr(object, part)
+ except AttributeError:
+ return None
+ return object
# --------------------------------------- interactive interpreter interface