changeset 30:6b0a17f31342

we should work w/ python 2.6+ now
author Atul Varma <varmaa@toolness.com>
date Thu, 24 Dec 2009 14:27:56 -0800
parents 9a7052db1045
children 86ba46e4f654
files bzapi.py test.py
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bzapi.py	Thu Dec 24 12:41:20 2009 -0800
+++ b/bzapi.py	Thu Dec 24 14:27:56 2009 -0800
@@ -23,8 +23,12 @@
 import urllib
 from datetime import datetime
 
+try:
+    import json
+except ImportError:
+    import simplejson as json
+
 import pymongo
-import simplejson as json
 
 def split_seq(seq, size):
     """
--- a/test.py	Thu Dec 24 12:41:20 2009 -0800
+++ b/test.py	Thu Dec 24 14:27:56 2009 -0800
@@ -3,10 +3,12 @@
 from copy import deepcopy
 from datetime import datetime, timedelta
 
-import simplejson as json
 import pymongo
 import bzapi
 
+# Easier than having to duplicate import logic...
+json = bzapi.json
+
 connection = pymongo.Connection('localhost', 27017)
 testdb = connection.bzapi_testing_db