summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/post-review8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/post-review b/scripts/post-review
index 6990b50..fb65e41 100755
--- a/scripts/post-review
+++ b/scripts/post-review
@@ -7,7 +7,6 @@ import mimetools
import ntpath
import os
import re
-import simplejson
import socket
import stat
import subprocess
@@ -25,6 +24,11 @@ except ImportError:
# Support Python versions before 2.5.
from md5 import md5
+try:
+ import json
+except ImportError:
+ import simplejson as json
+
# This specific import is necessary to handle the paths for
# cygwin enabled machines.
if (sys.platform.startswith('win')
@@ -478,7 +482,7 @@ class ReviewBoardServer(object):
Loads in a JSON file and returns the data if successful. On failure,
APIError is raised.
"""
- rsp = simplejson.loads(data)
+ rsp = json.loads(data)
if rsp['stat'] == 'fail':
raise APIError, rsp