Fix MemcachedSession

Remove asyncio loop argument
Remove asyncio.coroutine annotation as it is removed in Python 3.11
This commit is contained in:
Adrien YHUEL
2022-11-24 15:10:48 +01:00
parent 3e6b102b34
commit 5301b4418f
+3 -6
View File
@@ -327,15 +327,12 @@ class MemcachedSessionInterface(SessionInterface):
permanent=permanent, **kwargs) permanent=permanent, **kwargs)
self.backend = memcached self.backend = memcached
@asyncio.coroutine async def create(self, app: Quart) -> None:
def create(self, app: Quart) -> None:
if self.backend is None: if self.backend is None:
import aiomcache import aiomcache
loop = asyncio.get_running_loop() # self.backend = aiomcache.Client("127.0.0.1", 11211)
#self.backend = aiomcache.Client("127.0.0.1", 11211, loop=loop)
self.backend = aiomcache.Client(self._config.get('SESSION_MEMCACHED_HOST', '127.0.0.1'), self.backend = aiomcache.Client(self._config.get('SESSION_MEMCACHED_HOST', '127.0.0.1'),
self._config.get('SESSION_MEMCACHED_PORT', 11211), self._config.get('SESSION_MEMCACHED_PORT', 11211))
loop=loop)
def _get_memcache_timeout(self, timeout): def _get_memcache_timeout(self, timeout):
""" """