Skip to content

Commit f788320

Browse files
authored
Merge pull request #701 from berriesyl/patch-8
Create awaitme_berra_soyler.py
2 parents 9667a8e + 43285f4 commit f788320

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)