From 9d1daa4dc5cb001f83d1f49d49c3a4ba71a34ae7 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 7 Jan 2025 15:43:44 +0100 Subject: [PATCH] ifcpatch - try both out of tree and subpackage imports #5939 --- src/ifcpatch/ifcpatch/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ifcpatch/ifcpatch/__init__.py b/src/ifcpatch/ifcpatch/__init__.py index 0fbea7017f..907ab669fb 100644 --- a/src/ifcpatch/ifcpatch/__init__.py +++ b/src/ifcpatch/ifcpatch/__init__.py @@ -114,7 +114,8 @@ def execute(args: ArgumentsDict) -> Union[ifcopenshell.file, str]: def get_patch_input_argument_use(recipe: str) -> Literal["REQUIRED", "SUPPORTED", "IGNORED"]: - recipe_module = sys.modules[recipe] + # try out of tree and subpackage imports + recipe_module = sys.modules.get(f"ifcpatch.recipes.{recipe}") or sys.modules.get(recipe) return getattr(recipe_module.Patcher, "input_argument", "IGNORED")