Commits

Jason Pellerin committed d804f2b

Fixed issue 64: added is_generator to nose.util (alias for isgenerator)

Comments (0)

Files changed (2)

     for objects that can't be subclasses of anything.
     """
     try:
+        # This is a little tricky -- anything that's not a class will
+        # raise a TypeError when passed to issubclass.
         issubclass(obj, type)
     except TypeError:
         return False
         return func.func_code.co_flags & CO_GENERATOR != 0
     except AttributeError:
         return False
+# backwards compat (issue #64)
+is_generator = isgenerator
 
 
 def ispackage(path):

unit_tests/test_issue_064.py

+def test_is_generator_alias():
+    from nose.util import is_generator, isgenerator