From 737724c5fbe38c19b79adbd62009b7a0114d6d51 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Fri, 11 Oct 2024 16:57:14 -0700 Subject: [PATCH] fix another --- pyanalyze/test_arg_spec.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pyanalyze/test_arg_spec.py b/pyanalyze/test_arg_spec.py index 7abf0bd1..2a2d2980 100644 --- a/pyanalyze/test_arg_spec.py +++ b/pyanalyze/test_arg_spec.py @@ -210,10 +210,19 @@ def test_get_argspec(): Composite(KnownValue(ClassWithCall)), ) == asc.get_argspec(ClassWithCall.pure_async_classmethod) + # This behaves differently in 3.9 through 3.12 than in earlier and later + # versions. The behavior change was made in + # https://github.com/python/cpython/issues/63272 + # and undone in https://github.com/python/cpython/issues/89519 + if hasattr(ClassWithCall.classmethod_before_async, "decorator"): + callable = ClassWithCall.classmethod_before_async.decorator.fn + else: + callable = ClassWithCall.classmethod_before_async.__func__.fn + assert BoundMethodSignature( Signature.make( [SigParameter("cls"), SigParameter("ac")], - callable=ClassWithCall.classmethod_before_async.decorator.fn, + callable=callable, is_asynq=True, ), Composite(KnownValue(ClassWithCall)),