summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xLib/pydoc.py4
-rw-r--r--Misc/NEWS2
2 files changed, 4 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)
diff --git a/Misc/NEWS b/Misc/NEWS
index 857acce..1bcfb55 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -237,6 +237,8 @@ Core and Builtins
Library
-------
+- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
+
- Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
given as a low fd, it gets overwritten.