Fix https://github.com/IfcOpenShell/IfcOpenShell/issues/1664 : IFCPatch wouldn't correctly unpack un-hinted arguments

This commit is contained in:
Gorgious
2021-08-17 09:46:43 +02:00
parent 2c270a7315
commit f4fac9210d
+2 -3
View File
@@ -37,10 +37,9 @@ def execute(args, is_library=None):
print("# Loading patch recipe ...")
recipes = getattr(__import__("ifcpatch.recipes.{}".format(args["recipe"])), "recipes")
recipe = getattr(recipes, args["recipe"])
try:
# We unpack the arguments if the Patcher has been type-hinted and docstringed
if recipe.Patcher.__init__.__doc__ is not None:
patcher = recipe.Patcher(args["input"], ifc_file, logger, *args["arguments"])
except TypeError:
else:
patcher = recipe.Patcher(args["input"], ifc_file, logger, args["arguments"])
print("# Patching ...")
patcher.patch()