Skip to content

Commit

Permalink
new arg spec support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Aug 4, 2015
1 parent fb00cfd commit 3451b55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/netius/base/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def smtp_handler(
)

def in_signature(callable, name):
spec = inspect.getargspec(callable)
args = spec[0]; kwargs = spec[2]
has_full = hasattr(inspect, "getfullargspec")
if has_full: spec = inspect.getfullargspec(callable)
else: spec = inspect.getargspec(callable)
args, kwargs = spec[:2]
return (args and name in args) or (kwargs and "secure" in kwargs)

0 comments on commit 3451b55

Please sign in to comment.