Skip to content

Commit 43285f4

Browse files
authored
Create awaitme_berra_soyler.py
1 parent b73e7df commit 43285f4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Week05/awaitme_berra_soyler.py

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

0 commit comments

Comments
 (0)