aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2018-12-13 14:53:30 +0100
committerpracticalswift <practicalswift@users.noreply.github.com>2018-12-13 16:46:31 +0100
commit4de11a3682cc46fa2f81af8961eef360bedfa3a6 (patch)
tree07c4e4ee9312ad92b854567422c7cc8638670dbb
parent20c54eef6e41216a99b16bab2b5a7c0fb701f46e (diff)
Remove Python 2 import workarounds
-rwxr-xr-xcontrib/devtools/github-merge.py6
-rwxr-xr-xcontrib/linearize/linearize-data.py1
-rwxr-xr-xcontrib/linearize/linearize-hashes.py8
-rwxr-xr-xtest/util/bitcoin-util-test.py7
4 files changed, 4 insertions, 18 deletions
diff --git a/contrib/devtools/github-merge.py b/contrib/devtools/github-merge.py
index c7a64bd6f9..4f827401fb 100755
--- a/contrib/devtools/github-merge.py
+++ b/contrib/devtools/github-merge.py
@@ -14,7 +14,6 @@
# In case of a clean merge that is accepted by the user, the local branch with
# name $BRANCH is overwritten with the merged result, and optionally pushed.
-from __future__ import division,print_function,unicode_literals
import os
from sys import stdin,stdout,stderr
import argparse
@@ -23,10 +22,7 @@ import subprocess
import sys
import json
import codecs
-try:
- from urllib.request import Request,urlopen
-except ImportError:
- from urllib2 import Request,urlopen
+from urllib.request import Request, urlopen
# External tools (can be overridden using environment)
GIT = os.getenv('GIT','git')
diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py
index b6ead4a166..56c1fbfc92 100755
--- a/contrib/linearize/linearize-data.py
+++ b/contrib/linearize/linearize-data.py
@@ -7,7 +7,6 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
-from __future__ import print_function, division
import struct
import re
import os
diff --git a/contrib/linearize/linearize-hashes.py b/contrib/linearize/linearize-hashes.py
index 911c3c959d..e10b46d831 100755
--- a/contrib/linearize/linearize-hashes.py
+++ b/contrib/linearize/linearize-hashes.py
@@ -7,11 +7,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
-from __future__ import print_function
-try: # Python 3
- import http.client as httplib
-except ImportError: # Python 2
- import httplib
+from http.client import HttpConnection
import json
import re
import base64
@@ -31,7 +27,7 @@ class BitcoinRPC:
authpair = "%s:%s" % (username, password)
authpair = authpair.encode('utf-8')
self.authhdr = b"Basic " + base64.b64encode(authpair)
- self.conn = httplib.HTTPConnection(host, port=port, timeout=30)
+ self.conn = HttpConnection(host, port=port, timeout=30)
def execute(self, obj):
try:
diff --git a/test/util/bitcoin-util-test.py b/test/util/bitcoin-util-test.py
index 92fef30e13..7b1cc2b031 100755
--- a/test/util/bitcoin-util-test.py
+++ b/test/util/bitcoin-util-test.py
@@ -9,14 +9,9 @@ Runs automatically during `make check`.
Can also be run manually."""
-from __future__ import division,print_function,unicode_literals
-
import argparse
import binascii
-try:
- import configparser
-except ImportError:
- import ConfigParser as configparser
+import configparser
import difflib
import json
import logging