Skip to content

Commit 6b25d37

Browse files
committed
Use built in getfullargspec if __signature__ is present
Repaired the test suite to work with the 5.x series of the ``decorator`` module, which now appears to make use of the ``__signature__`` attribute. Change-Id: Id0ef2242ed7e400f5b2445df4be44b34598ae1e8
1 parent bd35733 commit 6b25d37

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

docs/build/unreleased/dec.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. change::
2+
:tags: bug, regression, tests
3+
4+
Repaired the test suite to work with the 5.x series of the ``decorator``
5+
module, which now appears to make use of the ``__signature__`` attribute.

dogpile/util/compat.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ def inspect_getfullargspec(func):
2828
2929
"""
3030

31+
# if a Signature is already present, as is the case with newer
32+
# "decorator" package, defer back to built in
33+
if hasattr(func, "__signature__"):
34+
return inspect.getfullargspec(func)
35+
3136
if inspect.ismethod(func):
3237
func = func.__func__
3338
if not inspect.isfunction(func):

0 commit comments

Comments
 (0)