Skip to content

Commit

Permalink
Merge 6a282dc into af56116
Browse files Browse the repository at this point in the history
  • Loading branch information
devPalacio committed Jul 20, 2023
2 parents af56116 + 6a282dc commit d8ef0f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions stone/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def main():
# The module should should contain an api variable that references a
# :class:`stone.api.Api` object.
try:
api_module = _load_module('api', args.api[0])
api_module = _load_module(args.api[0])

Check warning on line 170 in stone/cli.py

View check run for this annotation

Codecov / codecov/patch

stone/cli.py#L170

Added line #L170 was not covered by tests
api = api_module.api # pylint: disable=redefined-outer-name
except ImportError as e:
print('error: Could not import API description due to:',
Expand Down Expand Up @@ -341,7 +341,7 @@ def main():
if new_python_path not in sys.path:
sys.path.append(new_python_path)
try:
backend_module = _load_module('user_backend', args.backend)
backend_module = _load_module(args.backend)

Check warning on line 344 in stone/cli.py

View check run for this annotation

Codecov / codecov/patch

stone/cli.py#L344

Added line #L344 was not covered by tests
except Exception:
print("error: Importing backend '%s' module raised an exception:" %
args.backend, file=sys.stderr)
Expand All @@ -367,7 +367,7 @@ def main():
# easier to do debugging.
return api

def _load_module(name, path):
def _load_module(path):

Check warning on line 370 in stone/cli.py

View check run for this annotation

Codecov / codecov/patch

stone/cli.py#L370

Added line #L370 was not covered by tests
file_name = os.path.basename(path)
module_name = file_name.replace('.', '_')

Expand All @@ -379,8 +379,8 @@ def _load_module(name, path):
loader = importlib.machinery.SourceFileLoader(module_name, path)
module = loader.load_module() # pylint: disable=deprecated-method,no-value-for-parameter

sys.modules[name] = module

sys.modules[module_name] = module
logging.info("Loading module: %s", module_name)

Check warning on line 383 in stone/cli.py

View check run for this annotation

Codecov / codecov/patch

stone/cli.py#L382-L383

Added lines #L382 - L383 were not covered by tests
return module

if __name__ == '__main__':
Expand Down

0 comments on commit d8ef0f6

Please sign in to comment.