Add try/catch for simplejson vs json
authorZach Williams <hey@zachwill.com>
Sun, 8 Jul 2012 04:14:29 +0000 (21:14 -0700)
committerZach Williams <hey@zachwill.com>
Sun, 8 Jul 2012 04:14:29 +0000 (21:14 -0700)
requests/models.py

index 7eb3efe7d6919271820c15fdf9e830a6ba249087..40187244cc43bb2c788b6cb30682490da0535a85 100644 (file)
@@ -7,10 +7,14 @@ requests.models
 This module contains the primary objects that power Requests.
 """
 
-import json
 import os
 from datetime import datetime
 
+try:
+    import simplejson as json
+except ImportError:
+    import json
+
 from .hooks import dispatch_hook, HOOKS
 from .structures import CaseInsensitiveDict
 from .status_codes import codes