X Tutup
Skip to content

Commit 99d60e2

Browse files
committed
make __exit__ function syncronous
1 parent 3cc21b6 commit 99d60e2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gitlab/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import warnings
2424

2525
import httpx
26+
import asyncio
2627

2728
import gitlab.config
2829
from gitlab.const import * # noqa
@@ -146,8 +147,9 @@ def __init__(
146147
def __enter__(self):
147148
return self
148149

149-
async def __exit__(self, *args):
150-
await self.client.aclose()
150+
def __exit__(self, *args):
151+
loop = asyncio.get_event_loop()
152+
loop.run_until_complete(self.client.aclose())
151153

152154
def __getstate__(self):
153155
state = self.__dict__.copy()

0 commit comments

Comments
 (0)
X Tutup