mirror of
https://github.com/httpie/cli.git
synced 2025-06-25 12:01:41 +02:00
parent
24957e3b61
commit
e4bc363f9e
@ -2,12 +2,26 @@
|
|||||||
Python 2.6, 2.7, and 3.x compatibility.
|
Python 2.6, 2.7, and 3.x compatibility.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Borrow these from requests:
|
import sys
|
||||||
# noinspection PyUnresolvedReferences
|
|
||||||
from requests.compat import (
|
|
||||||
is_windows, bytes, str,
|
# Taken from `requests.compat`
|
||||||
is_py3, is_py26, is_pypy, is_py27
|
_ver = sys.version_info
|
||||||
)
|
is_py2 = (_ver[0] == 2)
|
||||||
|
is_py26 = (is_py2 and _ver[1] == 6)
|
||||||
|
is_py27 = (is_py2 and _ver[1] == 7)
|
||||||
|
is_py3 = (_ver[0] == 3)
|
||||||
|
is_pypy = ('pypy' in _ver)
|
||||||
|
is_windows = 'win32' in str(sys.platform).lower()
|
||||||
|
|
||||||
|
|
||||||
|
if is_py2:
|
||||||
|
bytes = str
|
||||||
|
str = unicode
|
||||||
|
elif is_py3:
|
||||||
|
str = str
|
||||||
|
bytes = bytes
|
||||||
|
|
||||||
|
|
||||||
try: # pragma: no cover
|
try: # pragma: no cover
|
||||||
# noinspection PyUnresolvedReferences,PyCompatibility
|
# noinspection PyUnresolvedReferences,PyCompatibility
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from requests.compat import is_windows
|
from httpie.compat import is_windows
|
||||||
|
|
||||||
from httpie.config import DEFAULT_CONFIG_DIR, Config
|
from httpie.config import DEFAULT_CONFIG_DIR, Config
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user