Commits

Charles-François Natali  committed 2bc740a

Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.

  • Participants
  • Parent commits c3aebd0
  • Branches 3.2

Comments (0)

Files changed (2)

File Lib/pydoc.py

 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)
 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.