File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -307,23 +307,17 @@ def isgeneratorfunction(obj):
307307
308308def _has_coroutine_mark (f ):
309309 while True :
310+ # Direct marker check
310311 if getattr (f , "_is_coroutine_marker" , None ) is _is_coroutine_mark :
311312 return True
312313
313- pm = getattr (f , "__partialmethod__" , None )
314- if isinstance (pm , functools .partialmethod ):
315- f = pm
316- continue
317-
318- if isinstance (f , functools .partialmethod ):
319- f = getattr (f , 'func' )
320- continue
321-
314+ # Methods: unwrap first (methods cannot be coroutine-marked)
322315 if ismethod (f ):
323316 f = f .__func__
324317 continue
325318
326- if isinstance (f , functools .partial ):
319+ # partial and partialmethod share .func
320+ if isinstance (f , (functools .partial , functools .partialmethod )):
327321 f = f .func
328322 continue
329323
You can’t perform that action at this time.
0 commit comments