From: Benjamin Peterson Date: Wed, 31 Dec 2008 23:48:39 +0000 (+0000) Subject: #4795 inspect.isgeneratorfunction() should return False instead of None X-Git-Tag: v2.7a1~2453 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ad09a4f2e557723395fc0840750c178924166b8;p=thirdparty%2FPython%2Fcpython.git #4795 inspect.isgeneratorfunction() should return False instead of None --- diff --git a/Lib/inspect.py b/Lib/inspect.py index d3d946d525c1..230df2b2a75e 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -161,6 +161,7 @@ def isgeneratorfunction(object): if (isfunction(object) or ismethod(object)) and \ object.func_code.co_flags & CO_GENERATOR: return True + return False def isgenerator(object): """Return true if the object is a generator. diff --git a/Misc/NEWS b/Misc/NEWS index 38d0dec64518..7eab3ae08e18 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -100,6 +100,9 @@ Core and Builtins Library ------- +- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when + the function is not a generator. + - Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case no MSVC compiler is found under Windows. Original patch by Philip Jenvey.