From 25299400fafc5f1dead16f04eb258dc60b59c148 Mon Sep 17 00:00:00 2001 From: Zach Williams Date: Sat, 7 Jul 2012 21:14:29 -0700 Subject: [PATCH] Add try/catch for simplejson vs json --- requests/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/requests/models.py b/requests/models.py index 7eb3efe7d6..40187244cc 100644 --- a/requests/models.py +++ b/requests/models.py @@ -7,10 +7,14 @@ 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