mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
merge 3.4 (#21548)
This commit is contained in:
commit
77c041ba64
4 changed files with 38 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue