Skip to content

Commit 243867b

Browse files
authored
Merge pull request #197 from EyalrAtBay/develop
Replaced deprecated getargspec with getfullargspec for Python 3+
2 parents a07adf0 + b36bfa6 commit 243867b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

reportportal_client/helpers.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import logging
1717
import time
1818
import uuid
19-
import warnings
2019
from platform import machine, processor, system
2120

2221
import six
@@ -169,12 +168,11 @@ def get_function_params(func, args, kwargs):
169168
:param kwargs: function's kwargs
170169
:return: a dictionary of values
171170
"""
172-
# Use deprecated method for python 2.7 compatibility, it's still here for
173-
# Python 3.10.2, so it's completely redundant to show the warning
174-
with warnings.catch_warnings():
175-
warnings.filterwarnings('ignore', category=DeprecationWarning)
176-
# noinspection PyDeprecation
171+
if six.PY2:
172+
# Use deprecated method for python 2.7 compatibility
177173
arg_spec = inspect.getargspec(func)
174+
else:
175+
arg_spec = inspect.getfullargspec(func)
178176
result = dict()
179177
for i, arg_name in enumerate(arg_spec.args):
180178
if i >= len(args):

0 commit comments

Comments
 (0)