summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-07-27 19:36:40 +0200
committerCharles-François Natali <neologix@free.fr>2011-07-27 19:36:40 +0200
commit0cf7e25c28d48cd41819bc60ced0c9daa785c67a (patch)
tree66d98c369dc4bd186700e3aa7be1b3f69b26c727 /Lib/pydoc.py
parentd8e3901478b0ddf0b2c6cb2094a3d74f0168e4bf (diff)
downloadcpython-git-0cf7e25c28d48cd41819bc60ced0c9daa785c67a.tar.gz
- 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 f11940438c..6bf6eb371b 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -212,8 +212,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 = open(filename)