Skip to content

Commit b36bfa6

Browse files
committed
Check if run by py2 or py3 by using six package
1 parent a6c1f4a commit b36bfa6

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

reportportal_client/helpers.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import logging
1717
import time
1818
import uuid
19-
import warnings
2019
from platform import machine, processor, system
21-
from aenum import PY3
2220

2321
import six
2422
from pkg_resources import DistributionNotFound, get_distribution
@@ -170,15 +168,11 @@ def get_function_params(func, args, kwargs):
170168
:param kwargs: function's kwargs
171169
:return: a dictionary of values
172170
"""
173-
# Use deprecated method for python 2.7 compatibility, it's still here for
174-
# Python 3.10.2, so it's completely redundant to show the warning
175-
with warnings.catch_warnings():
176-
warnings.filterwarnings('ignore', category=DeprecationWarning)
177-
# noinspection PyDeprecation
178-
if PY3:
179-
arg_spec = inspect.getfullargspec(func)
180-
else:
181-
arg_spec = inspect.getargspec(func)
171+
if six.PY2:
172+
# Use deprecated method for python 2.7 compatibility
173+
arg_spec = inspect.getargspec(func)
174+
else:
175+
arg_spec = inspect.getfullargspec(func)
182176
result = dict()
183177
for i, arg_name in enumerate(arg_spec.args):
184178
if i >= len(args):

0 commit comments

Comments
 (0)