Cleanup Python code: remove `import __future__`.
authorHartmut Goebel <h.goebel@crazy-compilers.com>
Sun, 10 Mar 2019 18:46:23 +0000 (19:46 +0100)
committerHartmut Goebel <h.goebel@crazy-compilers.com>
Sun, 10 Mar 2019 18:49:39 +0000 (19:49 +0100)
All of these only made Python 2 accept some Python 3 language idioms,
and the code is Python-3-only.

21 files changed:
contrib/scripts/find_typedefs.py
contrib/scripts/gdb-iterate-dll.py
contrib/scripts/gnunet-chk.py.in
contrib/scripts/gnunet_janitor.py.in
contrib/scripts/gnunet_pyexpect.py.in
contrib/scripts/pydiffer.py.in
contrib/scripts/pydmesg
src/arm/test_gnunet_arm.py.in
src/consensus/consensus-simulation.py.in
src/dht/test_dht_tools.py.in
src/fs/test_gnunet_fs_psd.py.in
src/integration-tests/gnunet_pyexpect.py.in
src/integration-tests/gnunet_testing.py.in
src/integration-tests/test_integration_bootstrap_and_connect.py.in
src/integration-tests/test_integration_clique.py.in
src/integration-tests/test_integration_disconnect.py.in
src/integration-tests/test_integration_disconnect_nat.py.in
src/integration-tests/test_integration_reconnect.py.in
src/integration-tests/test_integration_reconnect_nat.py.in
src/revocation/test_local_revocation.py.in
src/statistics/test_gnunet_statistics.py.in

index b344cee2b0b6cca5e5a94d884606b6e18c076876..804eae23576b47f6fc93f3cd7bfbdbbc2e996ee3 100644 (file)
@@ -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
index 388ef6e11e5288955ca0deb17543a541ea774070..9e6478e9fb015bb9db21b604ecd8c6dbd3e70b51 100644 (file)
@@ -1,5 +1,3 @@
-from __future__ import print_function
-from __future__ import unicode_literals
 from builtins import str
 from gdb import *
 
index 1f5a0726c79b5b8fca2302c867f3750364e40a94..ab0bc635f96fc03db1488682c75dddb43ef66303 100755 (executable)
@@ -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
index 4ae9ad12480eb6e13d827762e87958789c5f9464..79e32fb906b576fd35ec8cf6c7837e0e9fca7a70 100644 (file)
@@ -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
index 4202da8d008bda55b6fede4a9306ffaaf4a3eae3..9611fc0ae586bd979814b731bb74386be883744e 100644 (file)
@@ -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
index 1dbe856db064967bdad3351a8ab755c765fa5592..35d9ffa359a924cbf3fa0201c3856663ef391a71 100644 (file)
@@ -1,5 +1,5 @@
 #!@PYTHON@
-from __future__ import print_function
+
 import os
 import sys
 import difflib
index d60e08fe3be64e06a987ff48f6576aa47cdba8b4..9b21359f0bc24471b0804724b2744134a596bd9b 100755 (executable)
@@ -8,8 +8,6 @@
 pydmesg: dmesg with human-readable timestamps
 """
 
-from __future__ import with_statement
-
 import re
 import subprocess
 import sys
index 10bb58a9cf8ffd0f2275c3dfed22c02e463c623b..1d067b5d91829f1fde49706d6d4b58a5fbd9c464 100644 (file)
@@ -1,5 +1,5 @@
 #!@PYTHON@
-from __future__ import print_function
+
 import os
 import sys
 import shutil
index 161015d00019cc53c29ac919416e30e9e112fb28..23639b195af09b7d3927d86cc12f97b64ea2784f 100644 (file)
@@ -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():
index 38a9f9622590c7fc528b62f91c97fca06ade6be6..2d9379a42e4267a50c7140a9d1b79a4cf9b91bc8 100644 (file)
@@ -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
index d5a036c28e0e550436f82dd3bec3d6486cda4cf3..a1e4db9d50f386267d559115630c2fe2784a809e 100755 (executable)
@@ -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
index 83acb908fcc713b8698349ae59567e78e58cd8ed..000b8f99ae89088f155e8bad8efdb91786c5ca67 100644 (file)
@@ -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
index c9342ecf0820cd8e55a93da4cfe9a5b070b80b7a..667c3fff5aa4cc5727186c36d03fd304799dfec5 100644 (file)
@@ -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
index f0de1c0cd3181e841e2f942f3831a37726c232a6..4b4b356297e9caab1524c4092b09ce251ef20ae5 100755 (executable)
@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 #
-from __future__ import print_function
+
 import signal
 import sys
 import os
index b5d6dd518ca34cf6e08279ccc0bf140cbfd18a0e..0444cf24979254d6753e08c656b089156679b6ad 100755 (executable)
@@ -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
index a81c78540c716b93d6a92d67e265e2b1712eecc3..737014e61f0fcf9f3e6e4488c4c9addcc38bc490 100755 (executable)
@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 #
-from __future__ import print_function
+
 import sys
 import signal
 import os
index 601586f47eefb2f85493b4aabacff53091eb2ffc..c3d5d8901ec06f62b0aa709696d80907bdf5b447 100755 (executable)
@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 #
-from __future__ import print_function
+
 import sys
 import signal
 import os
index e8abacd4871aae75a1c0902b6746f416ea263617..8c4193680874219dfbcf62e60ff39d70e3d69e72 100755 (executable)
@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 #
-from __future__ import print_function
+
 import sys
 import os
 import subprocess
index 61d2ea9667a5df0a072c30e704481fe17addf794..45626d50d8b4097a80a45766b56778d7d9ff9c99 100755 (executable)
@@ -18,7 +18,7 @@
 #    SPDX-License-Identifier: AGPL3.0-or-later
 #
 #
-from __future__ import print_function
+
 import sys
 import os
 import subprocess
index 5caa616caebb8b807221176af63028321c468467..979a55d830003e1772570c6e3ab964ef97a94468 100644 (file)
@@ -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
index 64e66f238cd145f23081931eda1435aed2ba2b88..b14dc9d9e375fb16e5bf47335e878f5072803654 100644 (file)
@@ -1,5 +1,5 @@
 #!@PYTHON@
-from __future__ import print_function
+
 import os
 import sys
 import shutil