@@ -454,24 +454,22 @@ async def async_tasks():
454
454
method_name = f"{ method .__name__ } "
455
455
456
456
if inspect .iscoroutinefunction (method ):
457
- decorate = self ._decorate_async_function (
457
+ return self ._decorate_async_function (
458
458
method = method , capture_response = capture_response , method_name = method_name
459
459
)
460
460
elif inspect .isgeneratorfunction (method ):
461
- decorate = self ._decorate_generator_function (
461
+ return self ._decorate_generator_function (
462
462
method = method , capture_response = capture_response , method_name = method_name
463
463
)
464
464
elif hasattr (method , "__wrapped__" ) and inspect .isgeneratorfunction (method .__wrapped__ ):
465
- decorate = self ._decorate_generator_function_with_context_manager (
465
+ return self ._decorate_generator_function_with_context_manager (
466
466
method = method , capture_response = capture_response , method_name = method_name
467
467
)
468
468
else :
469
- decorate = self ._decorate_sync_function (
469
+ return self ._decorate_sync_function (
470
470
method = method , capture_response = capture_response , method_name = method_name
471
471
)
472
472
473
- return decorate
474
-
475
473
def _decorate_async_function (self , method : Callable = None , capture_response : bool = True , method_name : str = None ):
476
474
@functools .wraps (method )
477
475
async def decorate (* args , ** kwargs ):
@@ -650,9 +648,9 @@ def __build_config(
650
648
651
649
self ._config ["provider" ] = provider if provider is not None else self ._config ["provider" ]
652
650
self ._config ["auto_patch" ] = auto_patch if auto_patch is not None else self ._config ["auto_patch" ]
653
- self ._config ["service" ] = is_service if is_service else self ._config ["service" ]
654
- self ._config ["disabled" ] = is_disabled if is_disabled else self ._config ["disabled" ]
655
- self ._config ["patch_modules" ] = patch_modules if patch_modules else self ._config ["patch_modules" ]
651
+ self ._config ["service" ] = is_service or self ._config ["service" ]
652
+ self ._config ["disabled" ] = is_disabled or self ._config ["disabled" ]
653
+ self ._config ["patch_modules" ] = patch_modules or self ._config ["patch_modules" ]
656
654
657
655
@classmethod
658
656
def _reset_config (cls ):
0 commit comments