dfunckt / django-rules

Awesome Django authorization, without the database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

in python 3.6 the `inspect.getargspec()` used in the Predicate class is removed

jberends opened this issue · comments

In python 3.6 the getargspec is to be removed.

Django already provides some implementations to overcome this deprecation: see https://github.com/django/django/pull/4846/files (especially in here: https://github.com/django/django/pull/4846/files#diff-661c241427e347ab93c204317d4f68dc)

....
  File ".../_venv35/lib/python3.5/site-packages/rules/rulesets.py", line 1, in <module>
    from .predicates import predicate
  File ".../_venv35/lib/python3.5/site-packages/rules/predicates.py", line 260, in <module>
    always_true = predicate(lambda: True, name='always_true')
  File ".../_venv35/lib/python3.5/site-packages/rules/predicates.py", line 253, in predicate
    return inner(fn)
  File ".../_venv35/lib/python3.5/site-packages/rules/predicates.py", line 248, in inner
    p = Predicate(fn, name, **options)
  File ".../_venv35/lib/python3.5/site-packages/rules/predicates.py", line 70, in __init__
    argspec = inspect.getargspec(fn)
  File "/usr/lib/python3.5/inspect.py", line 1040, in getargspec
    stacklevel=2)
DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead

Fixed in 211fcd4, shipped with rules-1.4. Thank you!