Skip to content

Commit a9fab94

Browse files
committed
Fix module_spec.origin returning None bug
1 parent f2d066f commit a9fab94

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/beaker_bunsen/corpus/loaders/code_library_loader.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def discover(
8989
while modules_to_collect:
9090
module_spec = modules_to_collect.popleft()
9191

92-
if not module_spec.origin.endswith('.py'):
92+
if not module_spec.origin or not module_spec.origin.endswith('.py'):
9393
logger.info(f"Skipping importing non-python file {module_spec.origin}")
9494
continue
9595

src/beaker_bunsen/corpus/loaders/schemes.py

+3
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ def get_module_path(mod_name) -> str | None:
163163
continue
164164
file_path = spec.origin
165165

166+
if file_path is None:
167+
return None
168+
166169
if os.path.isfile(file_path):
167170
if tail:
168171
file_path = os.path.split(file_path)[0]

0 commit comments

Comments
 (0)