Skip to content

Commit

Permalink
Remove deprecation warnings
Browse files Browse the repository at this point in the history
Fixes #90
  • Loading branch information
ale-rt committed Feb 15, 2020
1 parent efdba84 commit 770e345
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/90.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove deprecation warnings
11 changes: 9 additions & 2 deletions plone/protect/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,15 @@ def __init__(self, *checkers):
self.checkers = checkers

def __call__(self, callable):
spec = inspect.getargspec(callable)
args, defaults = spec[0], spec[3]
try:
spec = inspect.getfullargspec(callable)
except AttributeError:
# Python 2.7 compatibility
spec = inspect.getargspec(callable)

args = spec.args
defaults = spec.defaults

try:
r_index = args.index("REQUEST")
except ValueError:
Expand Down

0 comments on commit 770e345

Please sign in to comment.