Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
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 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)