Skip to content

Commit 837b039

Browse files
authored
show deprecation warning only when required
Show the deprecation warning (used in workplane.text) only when the argument is actually used in the function call.
1 parent 03c3266 commit 837b039

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cadquery/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ def __call__(self, f):
5959
@wraps(f)
6060
def wrapped(*args, **kwargs):
6161

62-
f_sig_params = signature(f).parameters
63-
64-
if f_sig_params[self.name]:
62+
if self.name in kwargs:
6563
warn(
6664
f"Kwarg <{self.name}> will be removed. Please use <{self.new_name}>",
6765
FutureWarning,

0 commit comments

Comments
 (0)