]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#4795 inspect.isgeneratorfunction() should return False instead of None
authorBenjamin Peterson <benjamin@python.org>
Wed, 31 Dec 2008 23:48:39 +0000 (23:48 +0000)
committerBenjamin Peterson <benjamin@python.org>
Wed, 31 Dec 2008 23:48:39 +0000 (23:48 +0000)
Lib/inspect.py
Misc/NEWS

index d3d946d525c1c860c4490ff1585803d4d4559ecc..230df2b2a75e878d0f00c6351c86c6e908a77637 100644 (file)
@@ -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.
index 38d0dec64518b8e9415a317df7521aead7746d9b..7eab3ae08e18285da036209f990a9fa546ae05a8 100644 (file)
--- 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.