Skip to content

Commit d1f7329

Browse files
authored
Create awaitme_kadir_yildiz.py
1 parent f9db1ae commit d1f7329

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Week05/awaitme_kadir_yildiz.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import asyncio
2+
3+
def async_handler(func):
4+
async def wrapper(*args, **kwargs):
5+
outcome = func(*args, **kwargs)
6+
if asyncio.iscoroutine(outcome):
7+
return await outcome
8+
return outcome
9+
return wrapper

0 commit comments

Comments
 (0)