diff options
author | Charles-François Natali <neologix@free.fr> | 2011-07-27 17:42:05 (GMT) |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2011-07-27 17:42:05 (GMT) |
commit | 7a2f0c7802af898599d324f008a439c04ccb933a (patch) | |
tree | b1c0999d1e0f3609eaabdf0c7b94df406ba1cee5 /Lib/pydoc.py | |
parent | c353f68b1d811a7a6d73100882583dd71bbcadb7 (diff) | |
parent | 27c4e88552662c9b14496d4793e162e6d6481c96 (diff) | |
download | cpython-7a2f0c7802af898599d324f008a439c04ccb933a.zip cpython-7a2f0c7802af898599d324f008a439c04ccb933a.tar.gz cpython-7a2f0c7802af898599d324f008a439c04ccb933a.tar.bz2 |
Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index ffb4f89..ebd8a61 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -218,8 +218,8 @@ def source_synopsis(file): def synopsis(filename, cache={}): """Get the one-line summary out of a module file.""" mtime = os.stat(filename).st_mtime - lastupdate, result = cache.get(filename, (0, None)) - if lastupdate < mtime: + lastupdate, result = cache.get(filename, (None, None)) + if lastupdate is None or lastupdate < mtime: info = inspect.getmoduleinfo(filename) try: file = tokenize.open(filename) |