@@ -646,14 +646,18 @@ def _uncached_get_argspec(
646
646
unbound , impl , is_asynq , in_overload_resolution
647
647
)
648
648
if sig is not None :
649
- return make_bound_method (sig , Composite (KnownValue (obj .__self__ )))
649
+ return make_bound_method (
650
+ sig , Composite (KnownValue (obj .__self__ )), ctx = self .ctx
651
+ )
650
652
651
653
# for bound methods, see if we have an argspec for the unbound method
652
654
if inspect .ismethod (obj ) and obj .__self__ is not None :
653
655
argspec = self ._cached_get_argspec (
654
656
obj .__func__ , impl , is_asynq , in_overload_resolution
655
657
)
656
- return make_bound_method (argspec , Composite (KnownValue (obj .__self__ )))
658
+ return make_bound_method (
659
+ argspec , Composite (KnownValue (obj .__self__ )), ctx = self .ctx
660
+ )
657
661
658
662
# Must be after the check for bound methods, because otherwise we
659
663
# won't bind self correctly.
@@ -704,7 +708,9 @@ def _uncached_get_argspec(
704
708
_ENUM_CALL , impl , is_asynq , in_overload_resolution
705
709
)
706
710
self_value = SubclassValue (TypedValue (obj ))
707
- bound_sig = make_bound_method (signature , Composite (self_value ))
711
+ bound_sig = make_bound_method (
712
+ signature , Composite (self_value ), ctx = self .ctx
713
+ )
708
714
if bound_sig is None :
709
715
return None
710
716
sig = bound_sig .get_signature (
@@ -793,7 +799,9 @@ def _uncached_get_argspec(
793
799
)
794
800
# wrap if it's a bound method
795
801
if obj .instance is not None and argspec is not None :
796
- return make_bound_method (argspec , Composite (KnownValue (obj .instance )))
802
+ return make_bound_method (
803
+ argspec , Composite (KnownValue (obj .instance )), ctx = self .ctx
804
+ )
797
805
return argspec
798
806
799
807
if inspect .isclass (obj ):
@@ -856,7 +864,9 @@ def _uncached_get_argspec(
856
864
returns = return_type ,
857
865
allow_call = allow_call ,
858
866
)
859
- bound_sig = make_bound_method (signature , Composite (TypedValue (obj )))
867
+ bound_sig = make_bound_method (
868
+ signature , Composite (TypedValue (obj )), ctx = self .ctx
869
+ )
860
870
if bound_sig is None :
861
871
return None
862
872
if is_dunder_new :
@@ -894,7 +904,9 @@ def _uncached_get_argspec(
894
904
argspec = self ._cached_get_argspec (
895
905
method , impl , is_asynq , in_overload_resolution
896
906
)
897
- return make_bound_method (argspec , Composite (KnownValue (obj .__self__ )))
907
+ return make_bound_method (
908
+ argspec , Composite (KnownValue (obj .__self__ )), ctx = self .ctx
909
+ )
898
910
899
911
if hasattr_static (obj , "__call__" ):
900
912
# we could get an argspec here in some cases, but it's impossible to figure out
0 commit comments