From: Charles-François Natali Date: Wed, 27 Jul 2011 17:40:02 +0000 (+0200) Subject: Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime. X-Git-Tag: v3.2.2rc1~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=27c4e88552662c9b14496d4793e162e6d6481c96;p=thirdparty%2FPython%2Fcpython.git Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime. --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index aa4b6d5c4fa9..34b2f5166885 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) diff --git a/Misc/NEWS b/Misc/NEWS index 7da5eaab0281..e7c3a75a37bb 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -37,6 +37,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.