From 32679bf0af97f27a6abd23ebccc87d113116d317 Mon Sep 17 00:00:00 2001 From: leo zhou Date: Tue, 19 Feb 2013 14:15:44 +0800 Subject: [PATCH 1/2] Support python 2.5 for client --- local.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/local.py b/local.py index 65c3680..7d97275 100755 --- a/local.py +++ b/local.py @@ -20,6 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +from __future__ import with_statement import sys try: @@ -147,6 +148,12 @@ class Socks5Server(SocketServer.StreamRequestHandler): if __name__ == '__main__': + print "Python Version: %s " % '.'.join(str(v) for v in sys.version_info) + if sys.version_info < (2, 6): + import simplejson as json + else: + import json + os.chdir(os.path.dirname(__file__) or '.') print 'shadowsocks v0.9.3' From 3581d086cdfc37f8be5a2d2304c230b2fbef8134 Mon Sep 17 00:00:00 2001 From: leo zhou Date: Tue, 19 Feb 2013 15:34:46 +0800 Subject: [PATCH 2/2] Fix no json module error for python 2.5 --- local.py | 1 - 1 file changed, 1 deletion(-) diff --git a/local.py b/local.py index 7d97275..fc56d45 100755 --- a/local.py +++ b/local.py @@ -37,7 +37,6 @@ import struct import string import hashlib import os -import json import logging import getopt