fix py3 xmlrpc imports, close #1473
This commit is contained in:
@@ -31,6 +31,7 @@ if PY2:
|
||||
from types import ClassType
|
||||
import cgi
|
||||
import cookielib
|
||||
from xmlrpclib import ProtocolError
|
||||
BytesIO = StringIO
|
||||
reduce = reduce
|
||||
hashlib_md5 = hashlib.md5
|
||||
@@ -94,6 +95,7 @@ else:
|
||||
from urllib.request import FancyURLopener, urlopen
|
||||
from urllib.parse import quote as urllib_quote, unquote as urllib_unquote, urlencode
|
||||
from http import cookiejar as cookielib
|
||||
from xmlrpc.client import ProtocolError
|
||||
import html # warning, this is the python3 module and not the web2py html module
|
||||
hashlib_md5 = lambda s: hashlib.md5(bytes(s, 'utf8'))
|
||||
iterkeys = lambda d: iter(d.keys())
|
||||
|
||||
Reference in New Issue
Block a user