summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlikui <likui@yovole.com>2021-05-11 16:29:26 +0800
committerlikui <likui@yovole.com>2021-05-12 17:24:53 +0800
commita339e5d4cfcab52dbece47f91b19ca0a34f21603 (patch)
treece2bbb36968c04d40739423087f235a65e42cdb7
parent4eb58a81cbecfed3ed7c8c28ff50c1e7eb877d51 (diff)
downloadoslo-policy-a339e5d4cfcab52dbece47f91b19ca0a34f21603.tar.gz
Replace getargspec with getfullargspec
inspect.getargspec() is deprecated since py3 [1] https://docs.python.org/3/library/inspect.html#inspect.getargspec Change-Id: If7492d7f755c80687f867428d80e4efb1e1a5d57
-rw-r--r--oslo_policy/_checks.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/oslo_policy/_checks.py b/oslo_policy/_checks.py
index c813af6..3d00e6f 100644
--- a/oslo_policy/_checks.py
+++ b/oslo_policy/_checks.py
@@ -21,11 +21,6 @@ import inspect
import stevedore
-if hasattr(inspect, 'getfullargspec'):
- getargspec = inspect.getfullargspec
-else:
- getargspec = inspect.getargspec
-
registered_checks = {}
extension_checks = None
@@ -77,7 +72,7 @@ def _check(rule, target, creds, enforcer, current_rule):
"""
# Evaluate the rule
- argspec = getargspec(rule.__call__)
+ argspec = inspect.getfullargspec(rule.__call__)
rule_args = [target, creds, enforcer]
# Check if the rule argument must be included or not
if len(argspec.args) > 4: