Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Check for attr __name__ before trying to access it

    In order for freeze gun to play well with py.test
  • Loading branch information...
commit 637852e69e619d1f122f943c3aa324096c191ce0 1 parent 376a7d8
Javier Olaechea authored April 10, 2013

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  freezegun/api.py
2  freezegun/api.py
@@ -117,7 +117,7 @@ def start(self):
117 117
         for module in modules:
118 118
             if module is None:
119 119
                 continue
120  
-            if module.__name__ != 'datetime':
  120
+            if hasattr(module, "__name__") and module.__name__ != 'datetime':
121 121
                 if hasattr(module, 'datetime') and module.datetime == real_datetime:
122 122
                     module.datetime = FakeDatetime
123 123
                 if hasattr(module, 'date') and module.date == real_date:

0 notes on commit 637852e

Please sign in to comment.
Something went wrong with that request. Please try again.