mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Use to_bytes on open and to_native on load_source.
This commit is contained in:
parent
a8e6577403
commit
53a640f2cc
1 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ from collections import defaultdict
|
|||
|
||||
from ansible import constants as C
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils._text import to_bytes, to_text
|
||||
from ansible.module_utils._text import to_bytes, to_native, to_text
|
||||
from ansible.parsing.utils.yaml import from_yaml
|
||||
from ansible.plugins import get_plugin_class, MODULE_CACHE, PATH_CACHE, PLUGIN_PATH_CACHE
|
||||
from ansible.utils.display import Display
|
||||
|
@ -350,8 +350,8 @@ class PluginLoader:
|
|||
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", RuntimeWarning)
|
||||
with open(path, 'rb') as module_file:
|
||||
module = imp.load_source(full_name, to_bytes(path), module_file)
|
||||
with open(to_bytes(path), 'rb') as module_file:
|
||||
module = imp.load_source(full_name, to_native(path), module_file)
|
||||
return module
|
||||
|
||||
def _update_object(self, obj, name, path):
|
||||
|
|
Loading…
Reference in a new issue