From 4de0c12b438cf99e90070e723508ce636278e063 Mon Sep 17 00:00:00 2001 From: C Nelson Date: Fri, 6 Apr 2012 11:54:48 -0500 Subject: [PATCH] Adding an exception handler around the unittest import. --- extras/crystal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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