Skip to content

Commit

Permalink
Merge pull request #1358 from a-detiste/remove-future
Browse files Browse the repository at this point in the history
remove old Python2 __future__ statements

Fixes ticket:4090
  • Loading branch information
itamarst committed Feb 21, 2024
2 parents 40963cd + 43c9d04 commit 3afd2dc
Show file tree
Hide file tree
Showing 239 changed files with 1 addition and 819 deletions.
4 changes: 0 additions & 4 deletions integration/test_aaa_aardvark.py
Expand Up @@ -5,10 +5,6 @@
# You can safely skip any of these tests, it'll just appear to "take
# longer" to start the first test as the fixtures get built

from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from future.utils import PY2
if PY2:
Expand Down
4 changes: 0 additions & 4 deletions integration/test_sftp.py
Expand Up @@ -10,10 +10,6 @@
2. Its API is much simpler to use.
"""

from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from future.utils import PY2
if PY2:
Expand Down
6 changes: 0 additions & 6 deletions integration/test_streaming_logs.py
@@ -1,12 +1,6 @@
"""
Ported to Python 3.
"""
from __future__ import (
print_function,
unicode_literals,
absolute_import,
division,
)

from future.utils import PY2
if PY2:
Expand Down
1 change: 0 additions & 1 deletion misc/awesome_weird_stuff/boodlegrid.tac
@@ -1,6 +1,5 @@
# -*- python -*-

from __future__ import print_function

"""Monitor a Tahoe grid, by playing sounds in response to remote events.
Expand Down
1 change: 0 additions & 1 deletion misc/build_helpers/check-build.py
Expand Up @@ -2,7 +2,6 @@

# This helper script is used with the 'test-desert-island' Makefile target.

from __future__ import print_function

import sys

Expand Down
1 change: 0 additions & 1 deletion misc/build_helpers/gen-package-table.py
Expand Up @@ -2,7 +2,6 @@
# This script generates a table of dependencies in HTML format on stdout.
# It expects to be run in the tahoe-lafs-dep-eggs directory.

from __future__ import print_function

import re, os, sys
import pkg_resources
Expand Down
1 change: 0 additions & 1 deletion misc/build_helpers/run-deprecations.py
@@ -1,4 +1,3 @@
from __future__ import print_function

import sys, os, io, re
from twisted.internet import reactor, protocol, task, defer
Expand Down
1 change: 0 additions & 1 deletion misc/build_helpers/test-osx-pkg.py
Expand Up @@ -29,7 +29,6 @@
# characteristic: 14.1.0 (/Applications/tahoe.app/support/lib/python2.7/site-packages)
# pyasn1-modules: 0.0.5 (/Applications/tahoe.app/support/lib/python2.7/site-packages/pyasn1_modules-0.0.5-py2.7.egg)

from __future__ import print_function

import os, re, shutil, subprocess, sys, tempfile

Expand Down
1 change: 0 additions & 1 deletion misc/checkers/check_grid.py
@@ -1,4 +1,3 @@
from __future__ import print_function

"""
Test an existing Tahoe grid, both to see if the grid is still running and to
Expand Down
1 change: 0 additions & 1 deletion misc/coding_tools/check-debugging.py
Expand Up @@ -8,7 +8,6 @@
Usage: ./check-debugging.py src
"""

from __future__ import print_function

import sys, re, os

Expand Down
1 change: 0 additions & 1 deletion misc/coding_tools/check-interfaces.py
Expand Up @@ -4,7 +4,6 @@
#
# bin/tahoe @misc/coding_tools/check-interfaces.py

from __future__ import print_function

import os, sys, re, platform

Expand Down
1 change: 0 additions & 1 deletion misc/coding_tools/check-umids.py
Expand Up @@ -8,7 +8,6 @@

# ./check-umids.py src

from __future__ import print_function

import sys, re, os

Expand Down
1 change: 0 additions & 1 deletion misc/coding_tools/graph-deps.py
Expand Up @@ -21,7 +21,6 @@
# Install 'click' first. I run this with py2, but py3 might work too, if the
# wheels can be built with py3.

from __future__ import unicode_literals, print_function
import os, sys, subprocess, json, tempfile, zipfile, re, itertools
import email.parser
from pprint import pprint
Expand Down
1 change: 0 additions & 1 deletion misc/coding_tools/make-canary-files.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

"""
Given a list of nodeids and a 'convergence' file, create a bunch of files
Expand Down
1 change: 0 additions & 1 deletion misc/coding_tools/make_umid
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

"""Create a short probably-unique string for use as a umid= argument in a
Foolscap log() call, to make it easier to locate the source code that
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/cpu-watcher-poll.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

from foolscap import Tub, eventual
from twisted.internet import reactor
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/cpu-watcher-subscribe.py
@@ -1,6 +1,5 @@
# -*- python -*-

from __future__ import print_function

from twisted.internet import reactor
import sys
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/cpu-watcher.tac
@@ -1,6 +1,5 @@
# -*- python -*-

from __future__ import print_function

"""
# run this tool on a linux box in its own directory, with a file named
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/find-share-anomalies.py
Expand Up @@ -2,7 +2,6 @@

# feed this the results of 'tahoe catalog-shares' for all servers

from __future__ import print_function

import sys

Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_cpu_watcher
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

import os, sys, re
import urllib
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_diskleft
Expand Up @@ -5,7 +5,6 @@
# is left on all disks across the grid. The plugin should be configured with
# env_url= pointing at the diskwatcher.tac webport.

from __future__ import print_function

import os, sys, urllib, json

Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_disktotal
Expand Up @@ -6,7 +6,6 @@
# used. The plugin should be configured with env_url= pointing at the
# diskwatcher.tac webport.

from __future__ import print_function

import os, sys, urllib, json

Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_diskusage
Expand Up @@ -5,7 +5,6 @@
# is being used per unit time. The plugin should be configured with env_url=
# pointing at the diskwatcher.tac webport.

from __future__ import print_function

import os, sys, urllib, json

Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_diskused
Expand Up @@ -5,7 +5,6 @@
# used on all disks across the grid. The plugin should be configured with
# env_url= pointing at the diskwatcher.tac webport.

from __future__ import print_function

import os, sys, urllib, json

Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_doomsday
Expand Up @@ -5,7 +5,6 @@
# left before the grid fills up. The plugin should be configured with
# env_url= pointing at the diskwatcher.tac webport.

from __future__ import print_function

import os, sys, urllib, json

Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_estimate_files
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

import sys, os.path

Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_files
Expand Up @@ -18,7 +18,6 @@
# env.basedir_NODE3 /path/to/node3
#

from __future__ import print_function

import os, sys

Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_helperstats_active
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

import os, sys
import urllib
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_helperstats_fetched
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

import os, sys
import urllib
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_introstats
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

import os, sys
import urllib
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_nodememory
Expand Up @@ -4,7 +4,6 @@
# by 'allmydata start', then extracts the amount of memory they consume (both
# VmSize and VmRSS) from /proc

from __future__ import print_function

import os, sys, re

Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_overhead
Expand Up @@ -27,7 +27,6 @@
# This plugin should be configured with env_diskwatcher_url= pointing at the
# diskwatcher.tac webport, and env_deepsize_url= pointing at the PHP script.

from __future__ import print_function

import os, sys, urllib, json

Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_rootdir_space
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

import os, sys
import urllib
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_server_latency_
Expand Up @@ -42,7 +42,6 @@
# of course, these URLs must match the webports you have configured into the
# storage nodes.

from __future__ import print_function

import os, sys
import urllib
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_server_operations_
Expand Up @@ -32,7 +32,6 @@
# of course, these URLs must match the webports you have configured into the
# storage nodes.

from __future__ import print_function

import os, sys
import urllib
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_spacetime
Expand Up @@ -5,7 +5,6 @@
# then extrapolate to guess how many weeks/months/years of storage space we
# have left, and output it to another munin graph

from __future__ import print_function

import sys, os, time
import rrdtool
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_stats
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

import os
import json
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/munin/tahoe_storagespace
Expand Up @@ -18,7 +18,6 @@
# Allmydata-tahoe must be installed on the system where this plugin is used,
# since it imports a utility module from allmydata.utils .

from __future__ import print_function

import os, sys
import commands
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/provisioning/reliability.py
@@ -1,6 +1,5 @@
#! /usr/bin/python

from __future__ import print_function

import math
from allmydata.util import statistics
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/provisioning/test_provisioning.py
@@ -1,4 +1,3 @@
from __future__ import print_function

import unittest
from allmydata import provisioning
Expand Down
1 change: 0 additions & 1 deletion misc/operations_helpers/spacetime/diskwatcher.tac
@@ -1,6 +1,5 @@
# -*- python -*-

from __future__ import print_function

"""
Run this tool with twistd in its own directory, with a file named 'urls.txt'
Expand Down
1 change: 0 additions & 1 deletion misc/simulators/bench_spans.py
@@ -1,4 +1,3 @@
from __future__ import print_function

"""
To use this, get a trace file such as this one:
Expand Down
1 change: 0 additions & 1 deletion misc/simulators/count_dirs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

"""
This tool estimates how much space would be consumed by a filetree into which
Expand Down
1 change: 0 additions & 1 deletion misc/simulators/hashbasedsig.py
@@ -1,6 +1,5 @@
#!python

from __future__ import print_function

# range of hash output lengths
range_L_hash = [128]
Expand Down
1 change: 0 additions & 1 deletion misc/simulators/ringsim.py
Expand Up @@ -4,7 +4,6 @@

# import time

from __future__ import print_function

import math
from hashlib import md5 # sha1, sha256
Expand Down
1 change: 0 additions & 1 deletion misc/simulators/simulate_load.py
Expand Up @@ -2,7 +2,6 @@

# WARNING. There is a bug in this script so that it does not simulate the actual Tahoe Two server selection algorithm that it was intended to simulate. See http://allmydata.org/trac/tahoe-lafs/ticket/302 (stop permuting peerlist, use SI as offset into ring instead?)

from __future__ import print_function

from past.builtins import cmp

Expand Down
1 change: 0 additions & 1 deletion misc/simulators/simulator.py
@@ -1,6 +1,5 @@
#! /usr/bin/env python

from __future__ import print_function

import hashlib
import os, random
Expand Down
1 change: 0 additions & 1 deletion misc/simulators/sizes.py
@@ -1,6 +1,5 @@
#! /usr/bin/env python

from __future__ import print_function

from future.utils import PY2
if PY2:
Expand Down
1 change: 0 additions & 1 deletion misc/simulators/storage-overhead.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

import sys, math
from allmydata import uri, storage
Expand Down
Empty file added newsfragments/4090.minor
Empty file.
1 change: 0 additions & 1 deletion pyinstaller.spec
@@ -1,6 +1,5 @@
# -*- mode: python -*-

from __future__ import print_function

from distutils.sysconfig import get_python_lib
import hashlib
Expand Down
4 changes: 0 additions & 4 deletions src/allmydata/__main__.py
Expand Up @@ -2,10 +2,6 @@
Ported to Python 3.
"""

from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from future.utils import PY2
if PY2:
Expand Down
4 changes: 0 additions & 4 deletions src/allmydata/_monkeypatch.py
Expand Up @@ -4,10 +4,6 @@
Ported to Python 3.
"""

from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from future.utils import PY2
if PY2:
Expand Down

0 comments on commit 3afd2dc

Please sign in to comment.