bots: Improve code-style by using 'return' once.
This commit is contained in:
parent
402dda87fe
commit
dd13d0314b
|
@ -17,18 +17,18 @@ from zulip_bots.provision import provision_bot
|
||||||
|
|
||||||
|
|
||||||
def import_module_from_source(path, name=None):
|
def import_module_from_source(path, name=None):
|
||||||
if name is None:
|
if not name:
|
||||||
name = splitext(basename(path))[0]
|
name = splitext(basename(path))[0]
|
||||||
|
|
||||||
if six.PY2:
|
if six.PY2:
|
||||||
import imp
|
import imp
|
||||||
module = imp.load_source(name, path)
|
module = imp.load_source(name, path)
|
||||||
return module
|
|
||||||
else:
|
else:
|
||||||
import importlib.util
|
import importlib.util
|
||||||
spec = importlib.util.spec_from_file_location(name, path)
|
spec = importlib.util.spec_from_file_location(name, path)
|
||||||
module = importlib.util.module_from_spec(spec)
|
module = importlib.util.module_from_spec(spec)
|
||||||
spec.loader.exec_module(module)
|
spec.loader.exec_module(module)
|
||||||
|
|
||||||
return module
|
return module
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue