mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-08 01:09:44 +08:00
fix #415: ordered_dict error in Python 2.7
This commit is contained in:
@@ -7,6 +7,7 @@ httprunner.compat
|
|||||||
This module handles import compatibility issues between Python 2 and
|
This module handles import compatibility issues between Python 2 and
|
||||||
Python 3.
|
Python 3.
|
||||||
"""
|
"""
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import simplejson as json
|
import simplejson as json
|
||||||
@@ -39,8 +40,6 @@ except AttributeError:
|
|||||||
JSONDecodeError = ValueError
|
JSONDecodeError = ValueError
|
||||||
|
|
||||||
if is_py2:
|
if is_py2:
|
||||||
from urllib3.packages.ordered_dict import OrderedDict
|
|
||||||
|
|
||||||
builtin_str = str
|
builtin_str = str
|
||||||
bytes = str
|
bytes = str
|
||||||
str = unicode
|
str = unicode
|
||||||
@@ -51,8 +50,6 @@ if is_py2:
|
|||||||
FileNotFoundError = IOError
|
FileNotFoundError = IOError
|
||||||
|
|
||||||
elif is_py3:
|
elif is_py3:
|
||||||
from collections import OrderedDict
|
|
||||||
|
|
||||||
builtin_str = str
|
builtin_str = str
|
||||||
str = str
|
str = str
|
||||||
bytes = bytes
|
bytes = bytes
|
||||||
|
|||||||
Reference in New Issue
Block a user