Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit 68f6beb

Browse files
author
yury.l
committed
Fix conflict with names when importing library.
Prefix in name module move to function "walk_packages" for fix conflict with names importing packages. Bug #63
1 parent 623d3bd commit 68f6beb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

iota/commands/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ def discover_commands(package, recursively=True):
4949

5050
commands = {}
5151

52-
for _, name, is_package in walk_packages(package.__path__):
52+
for _, name, is_package in walk_packages(package.__path__, package.__name__ + '.'):
5353
# Loading the module is good enough; the CommandMeta metaclass will
5454
# ensure that any commands in the module get registered.
55-
sub_package = import_module(package.__name__ + '.' + name)
55+
56+
# Prefix in name module move to function "walk_packages" for fix
57+
# conflict with names importing packages
58+
# Bug https://github.com/iotaledger/iota.lib.py/issues/63
59+
sub_package = import_module(name)
5660

5761
# Index any command classes that we find.
5862
for (_, obj) in get_members(sub_package):

0 commit comments

Comments
 (0)