File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -453,15 +453,16 @@ def start_soon(
453
453
454
454
"""
455
455
try :
456
+ if not ctx .arg_types or len (ctx .arg_types [0 ]) != 1 :
457
+ raise ValueError ("must be used as a decorator" )
458
+
459
+ fn_type = get_proper_type (ctx .arg_types [0 ][0 ])
456
460
if (
457
- not ctx .arg_types
458
- or len (ctx .arg_types [0 ]) != 1
459
- or not isinstance (get_proper_type (ctx .arg_types [0 ][0 ]), CallableType )
461
+ not isinstance (fn_type , CallableType )
460
462
or not isinstance (get_proper_type (ctx .default_return_type ), CallableType )
461
463
):
462
464
raise ValueError ("must be used as a decorator" )
463
465
464
- fn_type = get_proper_type (ctx .arg_types [0 ][0 ]) # type: CallableType
465
466
callable_idx = - 1 # index in function arguments of the callable
466
467
callable_args_idx = - 1 # index in callable arguments of the StarArgs
467
468
callable_ty = None # type: Optional[CallableType]
You can’t perform that action at this time.
0 commit comments