Browse Source

support for python 2.5

1.4
clowwindy 12 years ago
parent
commit
0d54102520
  1. 2
      .travis.yml
  2. 12
      local.py
  3. 7
      server.py

2
.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:

12
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'

7
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)

Loading…
Cancel
Save