mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-18 20:47:54 +00:00
remove "from past.builtins import long"
This commit is contained in:
parent
0e5b6daa38
commit
2243ce3187
@ -8,7 +8,6 @@ Note that for RemoteInterfaces, the __remote_name__ needs to be a native string
|
|||||||
|
|
||||||
from future.utils import native_str
|
from future.utils import native_str
|
||||||
|
|
||||||
from past.builtins import long
|
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from zope.interface import Interface, Attribute
|
from zope.interface import Interface, Attribute
|
||||||
@ -2774,7 +2773,7 @@ class RIEncryptedUploadable(RemoteInterface):
|
|||||||
return Offset
|
return Offset
|
||||||
|
|
||||||
def get_all_encoding_parameters():
|
def get_all_encoding_parameters():
|
||||||
return (int, int, int, long)
|
return (int, int, int, int)
|
||||||
|
|
||||||
def read_encrypted(offset=Offset, length=ReadSize):
|
def read_encrypted(offset=Offset, length=ReadSize):
|
||||||
return ListOf(bytes)
|
return ListOf(bytes)
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
Ported to Python 3.
|
Ported to Python 3.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from past.builtins import long
|
|
||||||
|
|
||||||
from six import ensure_text, ensure_str
|
from six import ensure_text, ensure_str
|
||||||
|
|
||||||
import time
|
import time
|
||||||
@ -304,7 +302,7 @@ class IntroducerClient(service.Service, Referenceable):
|
|||||||
if "seqnum" in old:
|
if "seqnum" in old:
|
||||||
# must beat previous sequence number to replace
|
# must beat previous sequence number to replace
|
||||||
if ("seqnum" not in ann
|
if ("seqnum" not in ann
|
||||||
or not isinstance(ann["seqnum"], (int,long))):
|
or not isinstance(ann["seqnum"], int)):
|
||||||
self.log("not replacing old announcement, no valid seqnum: %s"
|
self.log("not replacing old announcement, no valid seqnum: %s"
|
||||||
% (ann,),
|
% (ann,),
|
||||||
parent=lp2, level=log.NOISY, umid="zFGH3Q")
|
parent=lp2, level=log.NOISY, umid="zFGH3Q")
|
||||||
|
@ -4,7 +4,6 @@ Ported to Python 3.
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from past.builtins import long
|
|
||||||
from six import ensure_text
|
from six import ensure_text
|
||||||
|
|
||||||
import time, os.path, textwrap
|
import time, os.path, textwrap
|
||||||
@ -262,7 +261,7 @@ class IntroducerService(service.MultiService, Referenceable): # type: ignore[mi
|
|||||||
if "seqnum" in old_ann:
|
if "seqnum" in old_ann:
|
||||||
# must beat previous sequence number to replace
|
# must beat previous sequence number to replace
|
||||||
if ("seqnum" not in ann
|
if ("seqnum" not in ann
|
||||||
or not isinstance(ann["seqnum"], (int,long))):
|
or not isinstance(ann["seqnum"], int)):
|
||||||
self.log("not replacing old ann, no valid seqnum",
|
self.log("not replacing old ann, no valid seqnum",
|
||||||
level=log.NOISY, umid="ySbaVw")
|
level=log.NOISY, umid="ySbaVw")
|
||||||
self._debug_counts["inbound_no_seqnum"] += 1
|
self._debug_counts["inbound_no_seqnum"] += 1
|
||||||
|
@ -4,8 +4,6 @@ Ported to Python 3.
|
|||||||
|
|
||||||
from future.utils import bchr
|
from future.utils import bchr
|
||||||
|
|
||||||
from past.builtins import long
|
|
||||||
|
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
import attr
|
import attr
|
||||||
from twisted.internet import defer, reactor
|
from twisted.internet import defer, reactor
|
||||||
@ -129,8 +127,8 @@ class FakeStorageServer(object):
|
|||||||
continue
|
continue
|
||||||
vector = response[shnum] = []
|
vector = response[shnum] = []
|
||||||
for (offset, length) in readv:
|
for (offset, length) in readv:
|
||||||
assert isinstance(offset, (int, long)), offset
|
assert isinstance(offset, int), offset
|
||||||
assert isinstance(length, (int, long)), length
|
assert isinstance(length, int), length
|
||||||
vector.append(shares[shnum][offset:offset+length])
|
vector.append(shares[shnum][offset:offset+length])
|
||||||
return response
|
return response
|
||||||
d.addCallback(_read)
|
d.addCallback(_read)
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
Ported to Python 3.
|
Ported to Python 3.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from past.builtins import long
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import unicodedata
|
import unicodedata
|
||||||
from zope.interface import implementer
|
from zope.interface import implementer
|
||||||
@ -1854,7 +1852,7 @@ class DeepStats(testutil.ReallyEqualMixin, unittest.TestCase):
|
|||||||
(101, 316, 216),
|
(101, 316, 216),
|
||||||
(317, 1000, 684),
|
(317, 1000, 684),
|
||||||
(1001, 3162, 99),
|
(1001, 3162, 99),
|
||||||
(long(3162277660169), long(10000000000000), 1),
|
(3162277660169, 10000000000000, 1),
|
||||||
])
|
])
|
||||||
|
|
||||||
class UCWEingMutableFileNode(MutableFileNode):
|
class UCWEingMutableFileNode(MutableFileNode):
|
||||||
|
@ -4,8 +4,6 @@ Tests for allmydata.util.humanreadable.
|
|||||||
This module has been ported to Python 3.
|
This module has been ported to Python 3.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from past.builtins import long
|
|
||||||
|
|
||||||
from twisted.trial import unittest
|
from twisted.trial import unittest
|
||||||
|
|
||||||
from allmydata.util import humanreadable
|
from allmydata.util import humanreadable
|
||||||
@ -26,7 +24,7 @@ class HumanReadable(unittest.TestCase):
|
|||||||
self.assertRegex(hr(foo), r"<foo\(\) at test_humanreadable.py:\d+>")
|
self.assertRegex(hr(foo), r"<foo\(\) at test_humanreadable.py:\d+>")
|
||||||
self.failUnlessEqual(hr(self.test_repr),
|
self.failUnlessEqual(hr(self.test_repr),
|
||||||
"<bound method HumanReadable.test_repr of <allmydata.test.test_humanreadable.HumanReadable testMethod=test_repr>>")
|
"<bound method HumanReadable.test_repr of <allmydata.test.test_humanreadable.HumanReadable testMethod=test_repr>>")
|
||||||
self.failUnlessEqual(hr(long(1)), "1")
|
self.failUnlessEqual(hr(1), "1")
|
||||||
self.assertIn(hr(10**40),
|
self.assertIn(hr(10**40),
|
||||||
["100000000000000000...000000000000000000",
|
["100000000000000000...000000000000000000",
|
||||||
"100000000000000000...0000000000000000000"])
|
"100000000000000000...0000000000000000000"])
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
Tests for allmydata.util.spans.
|
Tests for allmydata.util.spans.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from past.builtins import long
|
|
||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
@ -116,9 +114,6 @@ class ByteSpans(unittest.TestCase):
|
|||||||
s1 = Spans(3, 4) # 3,4,5,6
|
s1 = Spans(3, 4) # 3,4,5,6
|
||||||
self._check1(s1)
|
self._check1(s1)
|
||||||
|
|
||||||
s1 = Spans(long(3), long(4)) # 3,4,5,6
|
|
||||||
self._check1(s1)
|
|
||||||
|
|
||||||
s2 = Spans(s1)
|
s2 = Spans(s1)
|
||||||
self._check1(s2)
|
self._check1(s2)
|
||||||
|
|
||||||
@ -446,9 +441,9 @@ class StringSpans(unittest.TestCase):
|
|||||||
self.failUnlessEqual(ds.get(2, 4), b"fear")
|
self.failUnlessEqual(ds.get(2, 4), b"fear")
|
||||||
|
|
||||||
ds = klass()
|
ds = klass()
|
||||||
ds.add(long(2), b"four")
|
ds.add(2, b"four")
|
||||||
ds.add(long(3), b"ea")
|
ds.add(3, b"ea")
|
||||||
self.failUnlessEqual(ds.get(long(2), long(4)), b"fear")
|
self.failUnlessEqual(ds.get(2, 4), b"fear")
|
||||||
|
|
||||||
|
|
||||||
def do_scan(self, klass):
|
def do_scan(self, klass):
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
Tests for allmydata.util.time_format.
|
Tests for allmydata.util.time_format.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from past.builtins import long
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from twisted.trial import unittest
|
from twisted.trial import unittest
|
||||||
@ -103,7 +101,7 @@ class TimeFormat(unittest.TestCase, TimezoneMixin):
|
|||||||
def test_parse_date(self):
|
def test_parse_date(self):
|
||||||
p = time_format.parse_date
|
p = time_format.parse_date
|
||||||
self.failUnlessEqual(p("2010-02-21"), 1266710400)
|
self.failUnlessEqual(p("2010-02-21"), 1266710400)
|
||||||
self.failUnless(isinstance(p("2009-03-18"), (int, long)), p("2009-03-18"))
|
self.failUnless(isinstance(p("2009-03-18"), int), p("2009-03-18"))
|
||||||
self.failUnlessEqual(p("2009-03-18"), 1237334400)
|
self.failUnlessEqual(p("2009-03-18"), 1237334400)
|
||||||
|
|
||||||
def test_format_time(self):
|
def test_format_time(self):
|
||||||
|
@ -4,8 +4,6 @@ Netstring encoding and decoding.
|
|||||||
Ported to Python 3.
|
Ported to Python 3.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from past.builtins import long
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from typing import Optional, Tuple, List # noqa: F401
|
from typing import Optional, Tuple, List # noqa: F401
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -27,7 +25,7 @@ def split_netstring(data, numstrings,
|
|||||||
data does not exactly equal 'required_trailer'."""
|
data does not exactly equal 'required_trailer'."""
|
||||||
assert isinstance(data, bytes)
|
assert isinstance(data, bytes)
|
||||||
assert required_trailer is None or isinstance(required_trailer, bytes)
|
assert required_trailer is None or isinstance(required_trailer, bytes)
|
||||||
assert isinstance(position, (int, long)), (repr(position), type(position))
|
assert isinstance(position, int), (repr(position), type(position))
|
||||||
elements = []
|
elements = []
|
||||||
assert numstrings >= 0
|
assert numstrings >= 0
|
||||||
while position < len(data):
|
while position < len(data):
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
Ported to Python 3.
|
Ported to Python 3.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from past.builtins import long
|
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import hashlib
|
import hashlib
|
||||||
import re
|
import re
|
||||||
@ -1393,7 +1391,7 @@ class StatusElement(Element):
|
|||||||
size = op.get_size()
|
size = op.get_size()
|
||||||
if size is None:
|
if size is None:
|
||||||
size = "(unknown)"
|
size = "(unknown)"
|
||||||
elif isinstance(size, (int, long, float)):
|
elif isinstance(size, (int, float)):
|
||||||
size = abbreviate_size(size)
|
size = abbreviate_size(size)
|
||||||
|
|
||||||
result["total_size"] = size
|
result["total_size"] = size
|
||||||
|
Loading…
Reference in New Issue
Block a user