Skip to content

Commit

Permalink
use inspect.signature for decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
costela committed Aug 12, 2017
1 parent 44f5fba commit 508e1d1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions spyne/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import spyne.const.xml

from copy import copy
from inspect import isclass
from inspect import isclass, signature

from spyne import MethodDescriptor

Expand Down Expand Up @@ -58,10 +58,9 @@ def _produce_input_message(f, params, in_message_name, in_variable_names,

if argnames is None:
try:
argcount = f.__code__.co_argcount
argnames = f.__code__.co_varnames[arg_start:argcount]
argnames = tuple(signature(f).parameters)[arg_start:]

except AttributeError:
except ValueError:
raise TypeError(
"It's not possible to instrospect builtins. You must pass a "
"sequence of argument names as the '_args' argument to the "
Expand Down

0 comments on commit 508e1d1

Please sign in to comment.