Browse Source

Cleanup Python code: remove `import __future__`.

All of these only made Python 2 accept some Python 3 language idioms,
and the code is Python-3-only.
Hartmut Goebel 5 years ago
parent
commit
4deae01fba

+ 0 - 2
contrib/scripts/find_typedefs.py

@@ -1,7 +1,5 @@
 # XXX (F841): local variable 'li' is assigned to but never used
 
-from __future__ import print_function
-from __future__ import unicode_literals
 import os
 import re
 import sys

+ 0 - 2
contrib/scripts/gdb-iterate-dll.py

@@ -1,5 +1,3 @@
-from __future__ import print_function
-from __future__ import unicode_literals
 from builtins import str
 from gdb import *
 

+ 0 - 2
contrib/scripts/gnunet-chk.py.in

@@ -21,8 +21,6 @@
 # Brief:   Computes GNUNET style Content Hash Key for a given file
 # Author:  Sree Harsha Totakura
 
-from __future__ import print_function
-from __future__ import division
 from builtins import str
 from builtins import range
 from past.utils import old_div

+ 0 - 1
contrib/scripts/gnunet_janitor.py.in

@@ -22,7 +22,6 @@
 # gnunet janitor can be used by invoking `make' like this:
 # TESTS_ENVIRONMENT='${top_srcdir}/contrib/scripts/gnunet_janitor.py &&' make check
 
-from __future__ import print_function
 import os
 import re
 import subprocess

+ 1 - 1
contrib/scripts/gnunet_pyexpect.py.in

@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 # Testcase for gnunet-peerinfo
-from __future__ import print_function
+
 from builtins import object
 import os
 import re

+ 1 - 1
contrib/scripts/pydiffer.py.in

@@ -1,5 +1,5 @@
 #!@PYTHON@
-from __future__ import print_function
+
 import os
 import sys
 import difflib

+ 0 - 2
contrib/scripts/pydmesg

@@ -8,8 +8,6 @@
 pydmesg: dmesg with human-readable timestamps
 """
 
-from __future__ import with_statement
-
 import re
 import subprocess
 import sys

+ 1 - 1
src/arm/test_gnunet_arm.py.in

@@ -1,5 +1,5 @@
 #!@PYTHON@
-from __future__ import print_function
+
 import os
 import sys
 import shutil

+ 0 - 5
src/consensus/consensus-simulation.py.in

@@ -17,9 +17,6 @@
 #
 # SPDX-License-Identifier: AGPL3.0-or-later
 
-from __future__ import absolute_import
-from __future__ import print_function
-from __future__ import division
 from builtins import str
 from builtins import range
 from past.utils import old_div
@@ -49,8 +46,6 @@ def simulate(k, n, verbose):
         print("we have", num_ghosts, "ghost peers")
         # n.b. all peers with idx<k are evil
     peers = list(range(n))
-    # py2-3 compatible, backwards.
-    # refer to http://python-future.org/compatible_idioms.html#xrange
     info = [1 << x for x in range(n)]
 
     def done_p():

+ 1 - 2
src/dht/test_dht_tools.py.in

@@ -11,8 +11,7 @@
 #
 # The code does NOT depend on DHT routing or any actual P2P functionality.
 #
-from __future__ import print_function
-from __future__ import absolute_import
+
 import os
 import sys
 import shutil

+ 1 - 1
src/fs/test_gnunet_fs_psd.py.in

@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 # Testcase for file-sharing command-line tools (publish, search, download)
-from __future__ import print_function
+
 import sys
 import os
 import subprocess

+ 1 - 1
src/integration-tests/gnunet_pyexpect.py.in

@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 # Testcase for gnunet-peerinfo
-from __future__ import print_function
+
 from builtins import object
 import os
 import re

+ 1 - 2
src/integration-tests/gnunet_testing.py.in

@@ -18,8 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 # Functions for integration testing
-from __future__ import unicode_literals
-from __future__ import print_function
+
 from builtins import object
 from builtins import str
 import os

+ 1 - 1
src/integration-tests/test_integration_bootstrap_and_connect.py.in

@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 #
-from __future__ import print_function
+
 import signal
 import sys
 import os

+ 0 - 1
src/integration-tests/test_integration_clique.py.in

@@ -25,7 +25,6 @@
 # Conditions for successful exit:
 # Both peers have 2 connected peers in transport, core, topology, fs and dht
 
-from __future__ import print_function
 import sys
 import signal
 import os

+ 1 - 1
src/integration-tests/test_integration_disconnect.py.in

@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 #
-from __future__ import print_function
+
 import sys
 import signal
 import os

+ 1 - 1
src/integration-tests/test_integration_disconnect_nat.py.in

@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 #
-from __future__ import print_function
+
 import sys
 import signal
 import os

+ 1 - 1
src/integration-tests/test_integration_reconnect.py.in

@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 #
-from __future__ import print_function
+
 import sys
 import os
 import subprocess

+ 1 - 1
src/integration-tests/test_integration_reconnect_nat.py.in

@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 #
-from __future__ import print_function
+
 import sys
 import os
 import subprocess

+ 1 - 1
src/revocation/test_local_revocation.py.in

@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 # Testcase for ego revocation
-from __future__ import print_function
+
 from builtins import str
 import sys
 import os

+ 1 - 1
src/statistics/test_gnunet_statistics.py.in

@@ -1,5 +1,5 @@
 #!@PYTHON@
-from __future__ import print_function
+
 import os
 import sys
 import shutil