From 2563053214aa3fef0f7a8b10073e1ffa897e56f4 Mon Sep 17 00:00:00 2001 From: wjblanke Date: Mon, 27 Jul 2020 14:59:49 -0700 Subject: [PATCH] fix for 3.8 python pull 13528 - 38exceptwjb (#333) * fix for 3.8 python pull 13528 - https://github.com/python/cpython/pull/13528 * changes * flake8 --- CHANGELOG.md | 3 ++- src/full_node/full_node.py | 3 ++- src/full_node/sync_blocks_processor.py | 3 ++- src/wallet/wallet_node.py | 6 ++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4859cf8e5911..e5a3f0b75d88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ for setuptools_scm/PEP 440 reasons. - Binary wheels for ARM64/aarch64 also build for python 3.7. - See and remove plot directories from the UI and command line. - You can now specify the memory buffer in UI. +- Optimized MPIR for Sandybridge and Ivybridge CPUs under Windows ### Changed - `chia start wallet-server` changed to `chia start wallet`, for consistency. @@ -36,6 +37,7 @@ the blspy/bls-signatures library. - Fixed spelling error for "folder" on Plot tab. - Various node dependency security vulnerabilities have been fixed. - Request peers was not returning currently connected peers older than 1 day. +- Fixed timeout exception inheritance changes under python 3.8 (pull 13528) ### Deprecated - Removed legacy scripts such as chia-stop-server, chia-restart-harvester, etc. @@ -86,7 +88,6 @@ Graphical installer. Try `./chia -h` from in Windows or `/Applications/Chia.app/Contents/Resources/app.asar.unpacked/daemon` on MacOS. - ### Changed - Minor changes have been made across the repositories to better support compiling on OpenBSD. HT @n1000. diff --git a/src/full_node/full_node.py b/src/full_node/full_node.py index eb2073888d86..ee96866cd95a 100644 --- a/src/full_node/full_node.py +++ b/src/full_node/full_node.py @@ -379,7 +379,8 @@ async def _sync(self) -> OutboundMessageGenerator: phr.wait(), timeout=sleep_interval, ) break - except concurrent.futures.TimeoutError: + # https://github.com/python/cpython/pull/13528 + except (concurrent.futures.TimeoutError, asyncio.TimeoutError): total_time_slept += sleep_interval self.log.warning("Did not receive desired header hashes") diff --git a/src/full_node/sync_blocks_processor.py b/src/full_node/sync_blocks_processor.py index e4ad34c07ac0..9b46e1a5cea8 100644 --- a/src/full_node/sync_blocks_processor.py +++ b/src/full_node/sync_blocks_processor.py @@ -64,7 +64,8 @@ async def process(self) -> None: try: await asyncio.wait_for(future, timeout=self.SLEEP_INTERVAL) break - except concurrent.futures.TimeoutError: + # https://github.com/python/cpython/pull/13528 + except (concurrent.futures.TimeoutError, asyncio.TimeoutError): try: await future except asyncio.CancelledError: diff --git a/src/wallet/wallet_node.py b/src/wallet/wallet_node.py index 57d041074215..a252df9613e9 100644 --- a/src/wallet/wallet_node.py +++ b/src/wallet/wallet_node.py @@ -525,7 +525,8 @@ async def _sync(self): ].wait() await asyncio.wait_for(aw, timeout=sleep_interval) break - except concurrent.futures.TimeoutError: + # https://github.com/python/cpython/pull/13528 + except (concurrent.futures.TimeoutError, asyncio.TimeoutError): total_time_slept += sleep_interval self.log.info("Did not receive desired headers") @@ -635,7 +636,8 @@ async def _sync(self): future = asyncio.gather(*awaitables, return_exceptions=True) try: await asyncio.wait_for(future, timeout=sleep_interval) - except concurrent.futures.TimeoutError: + # https://github.com/python/cpython/pull/13528 + except (concurrent.futures.TimeoutError, asyncio.TimeoutError): try: await future except asyncio.CancelledError: