From 8f859cbf857f38e77f1fe85381bc81df09793de4 Mon Sep 17 00:00:00 2001 From: mdr0id Date: Mon, 27 Jan 2020 18:55:26 -0800 Subject: [PATCH] fix pyflakes errors --- qa/rpc-tests/httpbasics.py | 2 -- qa/rpc-tests/multi_rpc.py | 1 - qa/rpc-tests/test_framework/mininode.py | 3 +-- qa/rpc-tests/test_framework/script.py | 1 - qa/rpc-tests/test_framework/test_framework.py | 2 +- qa/rpc-tests/tx_expiry_helper.py | 4 ++-- qa/rpc-tests/wallet_shieldcoinbase.py | 2 +- qa/rpc-tests/wallet_shieldcoinbase_sapling.py | 9 +-------- qa/rpc-tests/wallet_shieldcoinbase_sprout.py | 9 +-------- qa/rpc-tests/zkey_import_export.py | 3 +-- qa/rpc-tests/zmq_test.py | 2 +- 11 files changed, 9 insertions(+), 29 deletions(-) diff --git a/qa/rpc-tests/httpbasics.py b/qa/rpc-tests/httpbasics.py index a404866b4..47de2b75b 100755 --- a/qa/rpc-tests/httpbasics.py +++ b/qa/rpc-tests/httpbasics.py @@ -10,8 +10,6 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, start_nodes, str_to_b64str -import base64 - from http.client import HTTPConnection from urllib.parse import urlparse diff --git a/qa/rpc-tests/multi_rpc.py b/qa/rpc-tests/multi_rpc.py index ab6e7291b..51c1b4474 100755 --- a/qa/rpc-tests/multi_rpc.py +++ b/qa/rpc-tests/multi_rpc.py @@ -14,7 +14,6 @@ from test_framework.util import ( start_nodes, str_to_b64str, ) -import base64 import os from http.client import HTTPConnection from urllib.parse import urlparse diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py index ff05ad262..1e86e8bc6 100755 --- a/qa/rpc-tests/test_framework/mininode.py +++ b/qa/rpc-tests/test_framework/mininode.py @@ -23,9 +23,8 @@ import asyncore import time import sys import random -from binascii import hexlify, unhexlify +from binascii import hexlify from io import BytesIO -from codecs import encode import hashlib from threading import RLock from threading import Thread diff --git a/qa/rpc-tests/test_framework/script.py b/qa/rpc-tests/test_framework/script.py index bddd8a386..9a4070bf1 100644 --- a/qa/rpc-tests/test_framework/script.py +++ b/qa/rpc-tests/test_framework/script.py @@ -22,7 +22,6 @@ if sys.version > '3': bord = lambda x: x import struct -import binascii from test_framework import bignum diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py index 3ddee7ee0..58ce72603 100755 --- a/qa/rpc-tests/test_framework/test_framework.py +++ b/qa/rpc-tests/test_framework/test_framework.py @@ -13,7 +13,7 @@ import shutil import tempfile import traceback -from .authproxy import AuthServiceProxy, JSONRPCException +from .authproxy import JSONRPCException from .util import assert_equal, check_json_precision, \ initialize_chain, initialize_chain_clean, \ start_nodes, connect_nodes_bi, stop_nodes, \ diff --git a/qa/rpc-tests/tx_expiry_helper.py b/qa/rpc-tests/tx_expiry_helper.py index 177caf5fd..94a6cc2c5 100755 --- a/qa/rpc-tests/tx_expiry_helper.py +++ b/qa/rpc-tests/tx_expiry_helper.py @@ -8,12 +8,12 @@ # from test_framework.mininode import CTransaction, NodeConnCB, mininode_lock, msg_ping, \ msg_pong -from test_framework.util import fail, hex_str_to_bytes, bytes_to_hex_str +from test_framework.util import fail import io import time -from binascii import hexlify, unhexlify +from binascii import unhexlify class TestNode(NodeConnCB): diff --git a/qa/rpc-tests/wallet_shieldcoinbase.py b/qa/rpc-tests/wallet_shieldcoinbase.py index 99773a5b6..f78caa927 100755 --- a/qa/rpc-tests/wallet_shieldcoinbase.py +++ b/qa/rpc-tests/wallet_shieldcoinbase.py @@ -7,7 +7,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.authproxy import JSONRPCException from test_framework.util import assert_equal, initialize_chain_clean, \ start_node, connect_nodes_bi, sync_blocks, sync_mempools, \ - wait_and_assert_operationid_status, get_coinbase_address, fail + wait_and_assert_operationid_status, get_coinbase_address from decimal import Decimal diff --git a/qa/rpc-tests/wallet_shieldcoinbase_sapling.py b/qa/rpc-tests/wallet_shieldcoinbase_sapling.py index c0c0ba278..2e5334349 100755 --- a/qa/rpc-tests/wallet_shieldcoinbase_sapling.py +++ b/qa/rpc-tests/wallet_shieldcoinbase_sapling.py @@ -1,13 +1,6 @@ #!/usr/bin/env python3 -import inspect -import os - -# To keep pyflakes happy -WalletShieldCoinbaseTest = object - -cwd = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) -exec(open(os.path.join(cwd, 'wallet_shieldcoinbase.py')).read()) +from wallet_shieldcoinbase import WalletShieldCoinbaseTest class WalletShieldCoinbaseSapling(WalletShieldCoinbaseTest): def __init__(self): diff --git a/qa/rpc-tests/wallet_shieldcoinbase_sprout.py b/qa/rpc-tests/wallet_shieldcoinbase_sprout.py index 1686e0366..d32201b40 100755 --- a/qa/rpc-tests/wallet_shieldcoinbase_sprout.py +++ b/qa/rpc-tests/wallet_shieldcoinbase_sprout.py @@ -1,13 +1,6 @@ #!/usr/bin/env python3 -import inspect -import os - -# To keep pyflakes happy -WalletShieldCoinbaseTest = object - -cwd = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) -exec(open(os.path.join(cwd, 'wallet_shieldcoinbase.py')).read()) +from wallet_shieldcoinbase import WalletShieldCoinbaseTest class WalletShieldCoinbaseSprout(WalletShieldCoinbaseTest): def __init__(self): diff --git a/qa/rpc-tests/zkey_import_export.py b/qa/rpc-tests/zkey_import_export.py index b33e532fd..3207922c1 100755 --- a/qa/rpc-tests/zkey_import_export.py +++ b/qa/rpc-tests/zkey_import_export.py @@ -6,8 +6,7 @@ from decimal import Decimal from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_greater_than, start_nodes,\ - initialize_chain_clean, connect_nodes_bi, wait_and_assert_operationid_status, \ - wait_and_assert_operationid_status_result + initialize_chain_clean, connect_nodes_bi, wait_and_assert_operationid_status from functools import reduce import logging diff --git a/qa/rpc-tests/zmq_test.py b/qa/rpc-tests/zmq_test.py index 12b5042af..403ced880 100755 --- a/qa/rpc-tests/zmq_test.py +++ b/qa/rpc-tests/zmq_test.py @@ -8,7 +8,7 @@ # from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal, bytes_to_hex_str, start_nodes, wait_and_assert_operationid_status +from test_framework.util import assert_equal, bytes_to_hex_str, start_nodes import zmq import struct