mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-02 22:39:42 +08:00
encode request data if it is in unicode/str type
This commit is contained in:
@@ -196,13 +196,13 @@ def get_imported_module(module_name):
|
||||
def get_imported_module_from_file(file_path):
|
||||
""" import module from python file path and return imported module
|
||||
"""
|
||||
|
||||
if is_py3:
|
||||
imported_module = importlib.machinery.SourceFileLoader(
|
||||
'module_name', file_path).load_module()
|
||||
else:
|
||||
# Python 2.7
|
||||
elif is_py2:
|
||||
imported_module = imp.load_source('module_name', file_path)
|
||||
else:
|
||||
raise RuntimeError("Neither Python 3 nor Python 2.")
|
||||
|
||||
return imported_module
|
||||
|
||||
|
||||
Reference in New Issue
Block a user