diff options
author | C Nelson <cnelsonsic@gmail.com> | 2012-04-06 11:54:48 -0500 |
---|---|---|
committer | C Nelson <cnelsonsic@gmail.com> | 2012-04-06 11:54:48 -0500 |
commit | 4de0c12b438cf99e90070e723508ce636278e063 (patch) | |
tree | 30bd6a2fc8eaed5ef6937ea12a3c7554d30994c8 | |
parent | 7b3b1f11b2887a58c7fd1a91345f16e2924d4879 (diff) |
Adding an exception handler around the unittest import.
-rw-r--r-- | extras/crystal.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/extras/crystal.py b/extras/crystal.py index ef03ec116..d303c9dfd 100644 --- a/extras/crystal.py +++ b/extras/crystal.py @@ -11,7 +11,10 @@ from bisect import bisect_left, bisect_right from itertools import izip #for testing all this crap -import unittest2 as unittest +try: + import unittest2 as unittest +except ImportError: + import unittest if not hasattr(json, "dumps"): json.dumps = json.write |