Skip to content

Commit 22115b5

Browse files
authored
Merge pull request #642 from erenmalkoc/patch-7
Create awaitme_eren_malkoc.py
2 parents 58be0a4 + 4911277 commit 22115b5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Week05/awaitme_eren_malkoc.py

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

0 commit comments

Comments
 (0)