Browse Source

Don't fail if m doesn't have a __class__ attr.

Ionel Cristian Mărieș 9 years ago
parent
commit
7d71d241f5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      celery/tests/case.py

+ 1 - 1
celery/tests/case.py

@@ -232,7 +232,7 @@ def _is_magic_module(m):
     # will load _tkinter and other shit when touched.
 
     # pyflakes refuses to accept 'noqa' for this isinstance.
-    cls, modtype = m.__class__, types.ModuleType
+    cls, modtype = getattr(m, '__class__', None), types.ModuleType
     return (cls is not modtype and (
         '__getattr__' in vars(m.__class__) or
         '__getattribute__' in vars(m.__class__)))