File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 5
5
# the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
6
6
7
7
8
+ import asyncio
8
9
import functools
9
10
import os
10
11
import pathlib
13
14
14
15
15
16
PY_36 = sys .version_info >= (3 , 6 )
17
+ PY_37 = sys .version_info >= (3 , 7 )
16
18
SYSTEM = platform .uname ().system
17
19
18
20
@@ -69,3 +71,11 @@ def get_pg_home_directory() -> pathlib.Path:
69
71
else :
70
72
def get_pg_home_directory () -> pathlib .Path :
71
73
return pathlib .Path .home ()
74
+
75
+
76
+ if PY_37 :
77
+ def current_asyncio_task (loop ):
78
+ return asyncio .current_task (loop )
79
+ else :
80
+ def current_asyncio_task (loop ):
81
+ return asyncio .Task .current_task (loop )
Original file line number Diff line number Diff line change @@ -1159,7 +1159,7 @@ async def _cancel(self, waiter):
1159
1159
waiter .set_exception (ex )
1160
1160
finally :
1161
1161
self ._cancellations .discard (
1162
- asyncio . Task . current_task (self ._loop ))
1162
+ compat . current_asyncio_task (self ._loop ))
1163
1163
if not waiter .done ():
1164
1164
waiter .set_result (None )
1165
1165
if w is not None :
You can’t perform that action at this time.
0 commit comments