summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-02-16 19:45:42 -0500
committerBenjamin Peterson <benjamin@python.org>2015-02-16 19:45:42 -0500
commit77c041ba64f87ac021c2a7a9314d9a3a1145057f (patch)
treee0f19e9fa4974fe541862907eae85fe1c3b5ba0a /Lib/pydoc.py
parent43036a66c37075534febdc4a4caaae8a364a9942 (diff)
parent54237f9feaefd209c2aaa5b4003810e69f6714f3 (diff)
downloadcpython-git-77c041ba64f87ac021c2a7a9314d9a3a1145057f.tar.gz
merge 3.4 (#21548)
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 60b0a9e545..1fc8cc72eb 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -269,7 +269,7 @@ def synopsis(filename, cache={}):
except:
return None
del sys.modules['__temp__']
- result = (module.__doc__ or '').splitlines()[0]
+ result = module.__doc__.splitlines()[0] if module.__doc__ else None
# Cache the result.
cache[filename] = (mtime, result)
return result
@@ -2073,7 +2073,7 @@ class ModuleScanner:
if onerror:
onerror(modname)
continue
- desc = (module.__doc__ or '').splitlines()[0]
+ desc = module.__doc__.splitlines()[0] if module.__doc__ else ''
path = getattr(module,'__file__',None)
name = modname + ' - ' + desc
if name.lower().find(key) >= 0: