Skip to content

Commit dd7b35d

Browse files
committed
Avoid importing non-node packages as nodes
1 parent a94021e commit dd7b35d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/goofi/node_helpers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import functools
22
import importlib
33
import inspect
4+
import os
45
import pkgutil
56
import time
67
import traceback
@@ -46,6 +47,10 @@ def _list_nodes_recursive(nodes=None, parent_module=goofi_nodes):
4647

4748
# iterate over all modules in the parent module
4849
for info in pkgutil.walk_packages(parent_module.__path__):
50+
if "goofi" + os.sep + "nodes" not in info.module_finder.path:
51+
# skip modules that are not in the goofi.nodes package
52+
continue
53+
4954
# import the module and measure the time it takes
5055
start = time.time()
5156
try:

0 commit comments

Comments
 (0)