Clean python2 remained stuff
Change-Id: I9658ebaa911f129f567197ff7ad531e093f9752f
This commit is contained in:
parent
9c04dc0c6f
commit
195ec82629
|
@ -27,19 +27,12 @@ LOG = logging.getLogger('os_ken.utils')
|
|||
|
||||
def load_source(name, pathname):
|
||||
"""
|
||||
This function provides the backward compatibility for 'imp.load_source'
|
||||
in Python 2.
|
||||
|
||||
:param name: Name used to create or access a module object.
|
||||
:param pathname: Path pointing to the source file.
|
||||
:return: Loaded and initialized module.
|
||||
"""
|
||||
if six.PY2:
|
||||
import imp
|
||||
return imp.load_source(name, pathname)
|
||||
else:
|
||||
loader = importlib.machinery.SourceFileLoader(name, pathname)
|
||||
return loader.load_module(name)
|
||||
loader = importlib.machinery.SourceFileLoader(name, pathname)
|
||||
return loader.load_module(name)
|
||||
|
||||
|
||||
def chop_py_suffix(p):
|
||||
|
|
Loading…
Reference in New Issue