Commits

Matthew Schinckel committed 4914ef8

Fix running on unconfigured virtualenv.

Comments (0)

Files changed (1)

timedelta/__init__.py

 __version__ = open(os.path.join(os.path.dirname(__file__), "VERSION")).read().strip()
 
 try:
+    import django
     from fields import TimedeltaField
     from helpers import (
         divide, multiply, modulo, 
         percentage, decimal_percentage,
         total_seconds
     )
-except ImportError:
+except (ImportError, django.core.exceptions.ImproperlyConfigured):
     pass