aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_dbcrash.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/feature_dbcrash.py')
-rwxr-xr-xtest/functional/feature_dbcrash.py17
1 files changed, 2 insertions, 15 deletions
diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py
index 8b06cc7372..62062926a6 100755
--- a/test/functional/feature_dbcrash.py
+++ b/test/functional/feature_dbcrash.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# Copyright (c) 2017-2018 The Bitcoin Core developers
+# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test recovery from a crash during chainstate writing.
@@ -28,18 +28,12 @@
import errno
import http.client
import random
-import sys
import time
from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut, ToHex
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, create_confirmed_utxos, hex_str_to_bytes
-HTTP_DISCONNECT_ERRORS = [http.client.CannotSendRequest]
-try:
- HTTP_DISCONNECT_ERRORS.append(http.client.RemoteDisconnected)
-except AttributeError:
- pass
class ChainstateWriteCrashTest(BitcoinTestFramework):
def set_test_params(self):
@@ -110,14 +104,7 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
try:
self.nodes[node_index].submitblock(block)
return True
- except http.client.BadStatusLine as e:
- # Prior to 3.5 BadStatusLine('') was raised for a remote disconnect error.
- if sys.version_info[0] == 3 and sys.version_info[1] < 5 and e.line == "''":
- self.log.debug("node %d submitblock raised exception: %s", node_index, e)
- return False
- else:
- raise
- except tuple(HTTP_DISCONNECT_ERRORS) as e:
+ except (http.client.CannotSendRequest, http.client.RemoteDisconnected) as e:
self.log.debug("node %d submitblock raised exception: %s", node_index, e)
return False
except OSError as e: