diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-12-01 05:27:29 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-12-01 05:27:29 +0000 |
commit | 4ebc57ff2a32f7dcaa765995e928b5def6a5cee3 (patch) | |
tree | 2947084793572d2fde66c303d3a51bd60ddb563c /lib/thandy/ClientCLI.py | |
parent | 2b288c14e157343c568e0bcc4eb217901bec1c01 (diff) |
Add a possible workaround for coderman's Ubuntu's simplejson snafus. 1) Only use json instead of simplejson if json actually works. Apparently there is sometimes a json module that is not the kind of json module you get with python2.6. 2) Check to see if json thinks you should escape /, and try to override that "helpful" choice.
git-svn-id: file:///home/or/svnrepo/updater/trunk@17422 55e972cd-5a19-0410-ae62-a4d7a52db4cd
Diffstat (limited to 'lib/thandy/ClientCLI.py')
-rw-r--r-- | lib/thandy/ClientCLI.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/thandy/ClientCLI.py b/lib/thandy/ClientCLI.py index fa73ab2..3f73662 100644 --- a/lib/thandy/ClientCLI.py +++ b/lib/thandy/ClientCLI.py @@ -7,10 +7,6 @@ import re import sys import time import traceback -try: - import json -except ImportError: - import simplejson as json import thandy.formats import thandy.util @@ -22,6 +18,8 @@ import thandy.packagesys.PackageSystem import thandy.socksurls import thandy.encodeToXML +json = thandy.util.importJSON() + class ControlLogFormatter: def _formatStr(self, s): s = '"%s"' % re.sub(r'(["\\])', r'\\\1', s) |