From 73f0c7a5740f0fd88c9697170a3555e89d086411 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Mon, 13 Sep 2010 18:48:02 +0200 Subject: [PATCH] if simplejson isn't available, fallback to json --- pyweb/mumble/tests.py | 6 +++++- pyweb/mumble/views.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pyweb/mumble/tests.py b/pyweb/mumble/tests.py index b494a24..bf53c8e 100644 --- a/pyweb/mumble/tests.py +++ b/pyweb/mumble/tests.py @@ -57,7 +57,11 @@ # * Log messages: yes # * Instance scope: ALL -import simplejson +try: + import simplejson +except ImportError: + import json as simplejson + from django.conf import settings from django.test import TestCase from django.test.client import Client diff --git a/pyweb/mumble/views.py b/pyweb/mumble/views.py index 9d3133e..7721be3 100644 --- a/pyweb/mumble/views.py +++ b/pyweb/mumble/views.py @@ -15,7 +15,11 @@ * GNU General Public License for more details. """ -import simplejson +try: + import simplejson +except ImportError: + import json as simplejson + from StringIO import StringIO from PIL import Image