support for python 2.5

This commit is contained in:
clowwindy 2013-03-05 00:02:17 +08:00
parent aa106baf51
commit 0d54102520
3 changed files with 12 additions and 9 deletions

View file

@ -1,12 +1,12 @@
language: python language: python
python: python:
- "2.5"
- "2.6" - "2.6"
- "2.7" - "2.7"
before_install: before_install:
- sudo apt-get update -qq - sudo apt-get update -qq
- sudo apt-get install -qq libevent-dev python-gevent - sudo apt-get install -qq libevent-dev python-gevent
- pip install gevent - pip install gevent
- pip install simplejson
script: script:
- python test.py - python test.py
branches: branches:

View file

@ -22,6 +22,10 @@
from __future__ import with_statement from __future__ import with_statement
import sys import sys
if sys.version_info < (2, 6):
import simplejson as json
else:
import json
try: try:
import gevent, gevent.monkey import gevent, gevent.monkey
@ -147,12 +151,6 @@ class Socks5Server(SocketServer.StreamRequestHandler):
if __name__ == '__main__': 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 '.') os.chdir(os.path.dirname(__file__) or '.')
print 'shadowsocks v0.9.4' print 'shadowsocks v0.9.4'

View file

@ -20,7 +20,12 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.
from __future__ import with_statement
import sys import sys
if sys.version_info < (2, 6):
import simplejson as json
else:
import json
try: try:
import gevent, gevent.monkey import gevent, gevent.monkey