summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-07-27 17:40:02 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-07-27 17:40:02 (GMT)
commit27c4e88552662c9b14496d4793e162e6d6481c96 (patch)
tree1fee2c2162d9a95f84e0db250099c9829580ba34 /Lib/pydoc.py
parent53516a82df8db500a968451daa54fc72eaed7056 (diff)
downloadcpython-27c4e88552662c9b14496d4793e162e6d6481c96.zip
cpython-27c4e88552662c9b14496d4793e162e6d6481c96.tar.gz
cpython-27c4e88552662c9b14496d4793e162e6d6481c96.tar.bz2
Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
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 aa4b6d5..34b2f51 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -224,8 +224,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)