Skip to content

Commit 78b0567

Browse files
replace preconditions call to getargspec with getfullargspec
handle getfullargspec .keywords renamed to .varkw
1 parent bc0e46e commit 78b0567

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

components/dash-table/tests/selenium/conftest.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from selenium.webdriver.support.wait import WebDriverWait
1212

1313

14-
1514
class PreconditionError(TypeError):
1615
pass
1716

@@ -31,8 +30,8 @@ def null_decorator(f):
3130

3231
precinfo = []
3332
for p in precs:
34-
spec = inspect.getargspec(p)
35-
if spec.varargs or spec.keywords:
33+
spec = inspect.getfullargspec(p)
34+
if spec.varargs or spec.varkw:
3635
raise PreconditionError(
3736
(
3837
"Invalid precondition must not accept * nor ** args:\n" + " {!s}\n"
@@ -47,7 +46,7 @@ def null_decorator(f):
4746
precinfo.append((appargs, closureargs, p))
4847

4948
def decorate(f):
50-
fspec = inspect.getargspec(f)
49+
fspec = inspect.getfullargspec(f)
5150

5251
for (appargs, closureargs, p) in precinfo:
5352
for apparg in appargs:
@@ -78,7 +77,7 @@ def g(*a, **kw):
7877
"Precondition failed in call {!r}{}:\n {!s}\n".format(
7978
g,
8079
inspect.formatargvalues(
81-
fspec.args, fspec.varargs, fspec.keywords, args
80+
fspec.args, fspec.varargs, fspec.varkw, args
8281
),
8382
stripped_source(p),
8483
)

0 commit comments

Comments
 (0)