Use importlib instead of imp
... because the imp module is deprecated since Python 3.4 . Change-Id: Id6f2dd16b05090c0409cdab9d77d15eb8ce87ca9
This commit is contained in:
parent
1224d2b7dd
commit
d9c167d070
@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
import imp
|
||||
import importlib
|
||||
import os
|
||||
|
||||
from docutils import core
|
||||
@ -97,7 +97,11 @@ class AnsibleAutoPluginDirective(Directive):
|
||||
|
||||
@staticmethod
|
||||
def load_module(filename):
|
||||
return imp.load_source('__ansible_module__', filename)
|
||||
spec = importlib.util.spec_from_file_location('__ansible_module__',
|
||||
filename)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
@staticmethod
|
||||
def build_documentation(module):
|
||||
|
Loading…
x
Reference in New Issue
Block a user