diff --git a/.travis.yml b/.travis.yml index a9cbc64..88095e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ language: python python: + - "2.5" - "2.6" - "2.7" before_install: - sudo apt-get update -qq - sudo apt-get install -qq libevent-dev python-gevent - pip install gevent - - pip install simplejson script: - python test.py branches: diff --git a/local.py b/local.py index 1d73927..2f8db87 100755 --- a/local.py +++ b/local.py @@ -22,7 +22,11 @@ from __future__ import with_statement import sys - +if sys.version_info < (2, 6): + import simplejson as json +else: + import json + try: import gevent, gevent.monkey gevent.monkey.patch_all(dns=gevent.version_info[0]>=1) @@ -147,12 +151,6 @@ 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.4' diff --git a/server.py b/server.py index 4f40fd7..b6869d1 100755 --- a/server.py +++ b/server.py @@ -20,8 +20,13 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +from __future__ import with_statement import sys - +if sys.version_info < (2, 6): + import simplejson as json +else: + import json + try: import gevent, gevent.monkey gevent.monkey.patch_all(dns=gevent.version_info[0]>=1)