Python 2.4 compatible imports.
- Fallback to md5 module if hashlib not there. - Import parse_qsl from cgi where it is in both 2.4 and 2.6
This commit is contained in:
parent
c95c24e743
commit
5958fb4996
|
@ -14,8 +14,12 @@ as taken from http://docs.python.org/dev/library/ssl.html#certificates
|
||||||
import sys, socket, ssl, struct, traceback
|
import sys, socket, ssl, struct, traceback
|
||||||
import os, resource, errno, signal # daemonizing
|
import os, resource, errno, signal # daemonizing
|
||||||
from base64 import b64encode, b64decode
|
from base64 import b64encode, b64decode
|
||||||
from hashlib import md5
|
try:
|
||||||
from urlparse import urlsplit, parse_qsl
|
from hashlib import md5
|
||||||
|
except:
|
||||||
|
from md5 import md5 # Support python 2.4
|
||||||
|
from urlparse import urlsplit
|
||||||
|
from cgi import parse_qsl
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
'listen_host' : '',
|
'listen_host' : '',
|
||||||
|
|
Loading…
Reference in New Issue