tdaemon.on_stop: adapt to python 3.8 - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 47ab8f8dc5ec05f56f4ef9baa6947f3071d357dd
DIR parent c2d6a902dde63b117ff234764d2e7c60cd50c43c
HTML Author: SomberNight <somber.night@protonmail.com>
Date: Wed, 15 Apr 2020 19:34:52 +0200
daemon.on_stop: adapt to python 3.8
(py3.8 has breaking changes re asyncio.CancelledError and asyncio.TimeoutError)
follow-up 308517d473d18fdc5a377e7296e0e6ab3f6c92b8
Diffstat:
M electrum/daemon.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
DIR diff --git a/electrum/daemon.py b/electrum/daemon.py
t@@ -32,6 +32,8 @@ import threading
from typing import Dict, Optional, Tuple, Iterable
from base64 import b64decode, b64encode
from collections import defaultdict
+import concurrent
+from concurrent import futures
import aiohttp
from aiohttp import web, client_exceptions
t@@ -507,7 +509,7 @@ class Daemon(Logger):
fut = asyncio.run_coroutine_threadsafe(self.taskgroup.cancel_remaining(), self.asyncio_loop)
try:
fut.result(timeout=2)
- except (asyncio.TimeoutError, asyncio.CancelledError):
+ except (concurrent.futures.TimeoutError, concurrent.futures.CancelledError, asyncio.CancelledError):
pass
self.logger.info("removing lockfile")
remove_lockfile(get_lockfile(self.config))