fa45d8aa5f
- health_checklist.json: 192.168.1.122→node122
- ocr_client.py: docstring IP→node122
- docs/market-data-requirements.md: IP→node122
- 所有API调用通过ProxyHandler({})绕过系统代理
Privoxy对node122:18003返回500,直连正常
33 lines
715 B
Python
33 lines
715 B
Python
"""Python 3 compatibility shims
|
|
"""
|
|
import sys
|
|
|
|
if sys.version_info[0] < 3:
|
|
PY3 = False
|
|
def b(s):
|
|
return s
|
|
try:
|
|
from cStringIO import StringIO
|
|
except ImportError:
|
|
from StringIO import StringIO
|
|
BytesIO = StringIO
|
|
text_type = unicode
|
|
binary_type = str
|
|
string_types = (basestring,)
|
|
integer_types = (int, long)
|
|
unichr = unichr
|
|
reload_module = reload
|
|
else:
|
|
PY3 = True
|
|
from importlib import reload as reload_module
|
|
def b(s):
|
|
return bytes(s, 'latin1')
|
|
from io import StringIO, BytesIO
|
|
text_type = str
|
|
binary_type = bytes
|
|
string_types = (str,)
|
|
integer_types = (int,)
|
|
unichr = chr
|
|
|
|
long_type = integer_types[-1]
|