Treat Py2 (not Py3) as the special case https://astrofrog.github.io/blog/2016/01/12/stop-writing-python-4-incompatible-code/
This commit is contained in:
parent
41f8ae95d1
commit
8e478e79ea
|
@ -39,17 +39,16 @@ __license__ = "apache2"
|
||||||
__email__ = 'amr.hassan@gmail.com'
|
__email__ = 'amr.hassan@gmail.com'
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info.major == 3:
|
if sys.version_info.major == 2:
|
||||||
import html.entities as htmlentitydefs
|
|
||||||
from http.client import HTTPSConnection
|
|
||||||
from urllib.parse import quote_plus as url_quote_plus
|
|
||||||
|
|
||||||
unichr = chr
|
|
||||||
|
|
||||||
elif sys.version_info.major == 2:
|
|
||||||
import htmlentitydefs
|
import htmlentitydefs
|
||||||
from httplib import HTTPSConnection
|
from httplib import HTTPSConnection
|
||||||
from urllib import quote_plus as url_quote_plus
|
from urllib import quote_plus as url_quote_plus
|
||||||
|
else:
|
||||||
|
import html.entities as htmlentitydefs
|
||||||
|
from http.client import HTTPSConnection
|
||||||
|
from urllib.parse import quote_plus as url_quote_plus
|
||||||
|
unichr = chr
|
||||||
|
|
||||||
|
|
||||||
STATUS_INVALID_SERVICE = 2
|
STATUS_INVALID_SERVICE = 2
|
||||||
STATUS_INVALID_METHOD = 3
|
STATUS_INVALID_METHOD = 3
|
||||||
|
|
Loading…
Reference in a new issue