From nobody Sun Apr 09 13:40:34 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PvYC65YlMz44S7n; Sun, 9 Apr 2023 13:40:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PvYC64WGLz4L7x; Sun, 9 Apr 2023 13:40:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681047634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=59qpe1S4+S6YtXUyDpQ8SfmuDFVs0YTw8HaCCmUsoLI=; b=ibJZOpcIOQ4C38gh6P4IHobR8XicVNWk8idVRpf505ygHEaZMW4XZ1Z1779MELg2RSXOEG vEFXu9QZfPuimP7yi5WTvo40+wL9cjf7j2mLdQSj5GN/jgh2URAMeeC8gyhyEnI8UBiQUY Xbm6zUS3acS9bsWf0fsOGRDgkGZRFsDvsu2O9SCpsr5EFn3QWdPe46c13CKDgq3K2mHb8n oUMUOfBhiDH6XlQpt2YH3iCR4hxE/cIbdX/OoioEFbFFCFrO5NJE4C+wr6qS7/+DwYQO39 hWVf/n7OeSwX/Z69ZXHD8OMVMNPZuTG4JdX9DbSiV5EfzgwavppuQ8PTDcBTbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681047634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=59qpe1S4+S6YtXUyDpQ8SfmuDFVs0YTw8HaCCmUsoLI=; b=kGYCWxdm2dY+A5jnu9Va/LrjhxGcextwDO1fNYJElufpe+xoWiORW7vPz9sXG+giAysnFV /y3b4VlG3gZBpL5Hnekgl6PiMlckE65uh6jeWGpp6rEYkAizv83/IxgieXVRcCJaEhFhEU G/5Af55mOFE1yBlpsuGODj2X3CrUxXYFNuZiylZiV7wczJdATm0C0YjiW3gP2jxXI7ZFtH 2Po+auhZa/OPTHAKzISBhkqu1tKfiuqzzEfWZi8ueOaNLkNXxJqrdEri9BsLOcijqHHmlP bjkTEqrwBdjgLSjiE1mhxpclNy1ZWQH2gv7+isfEdQAdofKJ5aJyj/vADOzaDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681047634; a=rsa-sha256; cv=none; b=nZVrGQcd42IWlCZ0kxJ/aCjeTts93BA/jyLcqvQ0dQtmaIm95fhEJ4/tPLlVYBCg4cs+cB FGrk0qkWQbDNQbpbpmoNmQ9+X2Xm1mP3bANYFjnJhQxnzUSoRauJ08Rm8DtjGLZBCH1FFC lcsCFwcJP3tx9bUuOphiXB5TJCe+AbS8G3qDqaI1JSFrIhBKxeLJftRDx/QHLCSK5fz7nL BWt336MOdpmaJDLix5Mx9JD1O4+M4AEr/ICT8A0qfly2U0VU6ZbbHlcuU5Ru9CrCjexHMg Q/bqG61np7sICiQsOqoWnmo78FqxJPigu1qeychLhON4+x3BeOMOXGmu9/pxVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PvYC624ZZz197Z; Sun, 9 Apr 2023 13:40:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 339DeYRH090448; Sun, 9 Apr 2023 13:40:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 339DeYcp090447; Sun, 9 Apr 2023 13:40:34 GMT (envelope-from git) Date: Sun, 9 Apr 2023 13:40:34 GMT Message-Id: <202304091340.339DeYcp090447@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 2973ab578ca7 - main - databases/py-zodbpickle: Update to 3.0 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2973ab578ca7c55b3edbca4fcf5e1dcd1282427d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=2973ab578ca7c55b3edbca4fcf5e1dcd1282427d commit 2973ab578ca7c55b3edbca4fcf5e1dcd1282427d Author: Po-Chuan Hsieh AuthorDate: 2023-04-09 13:30:56 +0000 Commit: Po-Chuan Hsieh CommitDate: 2023-04-09 13:36:44 +0000 databases/py-zodbpickle: Update to 3.0 Changes: https://github.com/zopefoundation/zodbpickle/blob/master/CHANGES.rst --- databases/py-zodbpickle/Makefile | 4 +- databases/py-zodbpickle/distinfo | 6 +- databases/py-zodbpickle/files/patch-2to3 | 777 ------------------------------- 3 files changed, 5 insertions(+), 782 deletions(-) diff --git a/databases/py-zodbpickle/Makefile b/databases/py-zodbpickle/Makefile index 9dd9ba0ca78f..4b9119b68ad4 100644 --- a/databases/py-zodbpickle/Makefile +++ b/databases/py-zodbpickle/Makefile @@ -1,5 +1,5 @@ PORTNAME= zodbpickle -PORTVERSION= 2.6 +PORTVERSION= 3.0 CATEGORIES= databases python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -11,7 +11,7 @@ WWW= https://github.com/zopefoundation/zodbpickle LICENSE= PSFL ZPL21 LICENSE_COMB= multi -USES= python:3.6+ +USES= python:3.7+ USE_PYTHON= autoplist concurrent distutils post-install: diff --git a/databases/py-zodbpickle/distinfo b/databases/py-zodbpickle/distinfo index 20ed99825ab7..f2e37a9e6a3d 100644 --- a/databases/py-zodbpickle/distinfo +++ b/databases/py-zodbpickle/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1669057673 -SHA256 (zodbpickle-2.6.tar.gz) = 05978fc24ff93f349045aea11fa3ad1efa80eab19cab6251eac7417c6311a1d2 -SIZE (zodbpickle-2.6.tar.gz) = 186052 +TIMESTAMP = 1680726106 +SHA256 (zodbpickle-3.0.tar.gz) = c8dc8c1ac233293684067af591f7ebc4a86670d6deffbaa7d35d34cc0f784e84 +SIZE (zodbpickle-3.0.tar.gz) = 110969 diff --git a/databases/py-zodbpickle/files/patch-2to3 b/databases/py-zodbpickle/files/patch-2to3 deleted file mode 100644 index 36d74583685a..000000000000 --- a/databases/py-zodbpickle/files/patch-2to3 +++ /dev/null @@ -1,777 +0,0 @@ ---- src/zodbpickle/pickle_2.py.orig 2022-09-15 06:24:37 UTC -+++ src/zodbpickle/pickle_2.py -@@ -27,8 +27,8 @@ Misc variables: - __version__ = "$Revision: 72223 $" # Code version - - from types import * --from copy_reg import dispatch_table --from copy_reg import _extension_registry, _inverted_registry, _extension_cache -+from copyreg import dispatch_table -+from copyreg import _extension_registry, _inverted_registry, _extension_cache - import marshal - import sys - import struct -@@ -513,22 +513,22 @@ class Pickler: - if StringType is UnicodeType: - # This is true for Jython - def save_string(self, obj, pack=struct.pack): -- unicode = obj.isunicode() -+ str = obj.isunicode() - - if self.bin: -- if unicode: -+ if str: - obj = obj.encode("utf-8") - l = len(obj) -- if l < 256 and not unicode: -+ if l < 256 and not str: - self.write(SHORT_BINSTRING + chr(l) + obj) - else: - s = pack(" 0 - ashex = hex(x) - njunkchars = 2 + ashex.endswith('L') -@@ -1499,19 +1499,19 @@ def decode_long(data): - - nbytes = len(data) - if nbytes == 0: -- return 0L -+ return 0 - ashex = _binascii.hexlify(data[::-1]) -- n = long(ashex, 16) # quadratic time before Python 2.3; linear now -+ n = int(ashex, 16) # quadratic time before Python 2.3; linear now - if data[-1] >= '\x80': -- n -= 1L << (nbytes * 8) -+ n -= 1 << (nbytes * 8) - return n - - # Shorthands - - try: -- from cStringIO import StringIO -+ from io import StringIO - except ImportError: -- from StringIO import StringIO -+ from io import StringIO - - def dump(obj, file, protocol=None): - Pickler(file, protocol).dump(obj) ---- src/zodbpickle/pickletools_2.py.orig 2022-09-15 06:24:37 UTC -+++ src/zodbpickle/pickletools_2.py -@@ -429,7 +429,7 @@ def read_unicodestringnl(f): - raise ValueError("no newline found when trying to read " - "unicodestringnl") - data = data[:-1] # lose the newline -- return unicode(data, 'raw-unicode-escape') -+ return str(data, 'raw-unicode-escape') - - unicodestringnl = ArgumentDescriptor( - name='unicodestringnl', -@@ -465,7 +465,7 @@ def read_unicodestring4(f): - raise ValueError("unicodestring4 byte count < 0: %d" % n) - data = f.read(n) - if len(data) == n: -- return unicode(data, 'utf-8') -+ return str(data, 'utf-8') - raise ValueError("expected %d bytes in a unicodestring4, but only %d " - "remain" % (n, len(data))) - -@@ -509,7 +509,7 @@ def read_decimalnl_short(f): - try: - return int(s) - except OverflowError: -- return long(s) -+ return int(s) - - def read_decimalnl_long(f): - r""" -@@ -532,7 +532,7 @@ def read_decimalnl_long(f): - s = read_stringnl(f, decode=False, stripquotes=False) - if not s.endswith("L"): - raise ValueError("trailing 'L' required in %r" % s) -- return long(s) -+ return int(s) - - - decimalnl_short = ArgumentDescriptor( -@@ -731,12 +731,12 @@ pyint = StackObject( - - pylong = StackObject( - name='long', -- obtype=long, -+ obtype=int, - doc="A long (as opposed to short) Python integer object.") - - pyinteger_or_bool = StackObject( - name='int_or_bool', -- obtype=(int, long, bool), -+ obtype=(int, int, bool), - doc="A Python integer object (short or long), or " - "a Python bool.") - -@@ -757,7 +757,7 @@ pystring = StackObject( - - pyunicode = StackObject( - name='unicode', -- obtype=unicode, -+ obtype=str, - doc="A Python Unicode string object.") - - pynone = StackObject( -@@ -1800,18 +1800,18 @@ def assure_pickle_consistency(verbose=False): - for name in pickle.__all__: - if not re.match("[A-Z][A-Z0-9_]+$", name): - if verbose: -- print "skipping %r: it doesn't look like an opcode name" % name -+ print("skipping %r: it doesn't look like an opcode name" % name) - continue - picklecode = getattr(pickle, name) - if not isinstance(picklecode, str) or len(picklecode) != 1: - if verbose: -- print ("skipping %r: value %r doesn't look like a pickle " -- "code" % (name, picklecode)) -+ print(("skipping %r: value %r doesn't look like a pickle " -+ "code" % (name, picklecode))) - continue - if picklecode in copy: - if verbose: -- print "checking name %r w/ code %r for consistency" % ( -- name, picklecode) -+ print("checking name %r w/ code %r for consistency" % ( -+ name, picklecode)) - d = copy[picklecode] - if d.name != name: - raise ValueError("for pickle code %r, pickle.py uses name %r " -@@ -1827,7 +1827,7 @@ def assure_pickle_consistency(verbose=False): - (name, picklecode)) - if copy: - msg = ["we appear to have pickle opcodes that pickle.py doesn't have:"] -- for code, d in copy.items(): -+ for code, d in list(copy.items()): - msg.append(" name %r with code %r" % (d.name, code)) - raise ValueError("\n".join(msg)) - -@@ -1861,7 +1861,7 @@ def genops(pickle): - to query its current position) pos is None. - """ - -- import cStringIO as StringIO -+ import io as StringIO - - if isinstance(pickle, str): - pickle = StringIO.StringIO(pickle) -@@ -1969,7 +1969,7 @@ def dis(pickle, out=None, memo=None, indentlevel=4): - errormsg = None - for opcode, arg, pos in genops(pickle): - if pos is not None: -- print >> out, "%5d:" % pos, -+ print("%5d:" % pos, end=' ', file=out) - - line = "%-4s %s%s" % (repr(opcode.code)[1:-1], - indentchunk * len(markstack), -@@ -2034,7 +2034,7 @@ def dis(pickle, out=None, memo=None, indentlevel=4): - line += ' ' + repr(arg) - if markmsg: - line += ' ' + markmsg -- print >> out, line -+ print(line, file=out) - - if errormsg: - # Note that we delayed complaining until the offending opcode -@@ -2053,7 +2053,7 @@ def dis(pickle, out=None, memo=None, indentlevel=4): - - stack.extend(after) - -- print >> out, "highest protocol among opcodes =", maxproto -+ print("highest protocol among opcodes =", maxproto, file=out) - if stack: - raise ValueError("stack not empty after STOP: %r" % stack) - ---- src/zodbpickle/tests/pickletester_2.py.orig 2022-09-15 06:24:37 UTC -+++ src/zodbpickle/tests/pickletester_2.py -@@ -1,8 +1,8 @@ - import io - import unittest --import StringIO --import cStringIO --import copy_reg -+import io -+import io -+import copyreg - import sys - - try: -@@ -45,7 +45,7 @@ from zodbpickle import pickletools_2 as pickletools - # for proto in protocols: - # kind of outer loop. - assert pickle.HIGHEST_PROTOCOL == cPickle.HIGHEST_PROTOCOL == 3 --protocols = range(pickle.HIGHEST_PROTOCOL + 1) -+protocols = list(range(pickle.HIGHEST_PROTOCOL + 1)) - - # Copy of test.test_support.run_with_locale. This is needed to support Python - # 2.4, which didn't include it. This is all to support test_xpickle, which -@@ -78,7 +78,7 @@ def run_with_locale(catstr, *locales): - finally: - if locale and orig_locale: - locale.setlocale(category, orig_locale) -- inner.func_name = func.func_name -+ inner.__name__ = func.__name__ - inner.__doc__ = func.__doc__ - return inner - return decorator -@@ -114,21 +114,21 @@ class ExtensionSaver: - # there is one). - def __init__(self, code): - self.code = code -- if code in copy_reg._inverted_registry: -- self.pair = copy_reg._inverted_registry[code] -- copy_reg.remove_extension(self.pair[0], self.pair[1], code) -+ if code in copyreg._inverted_registry: -+ self.pair = copyreg._inverted_registry[code] -+ copyreg.remove_extension(self.pair[0], self.pair[1], code) - else: - self.pair = None - - # Restore previous registration for code. - def restore(self): - code = self.code -- curpair = copy_reg._inverted_registry.get(code) -+ curpair = copyreg._inverted_registry.get(code) - if curpair is not None: -- copy_reg.remove_extension(curpair[0], curpair[1], code) -+ copyreg.remove_extension(curpair[0], curpair[1], code) - pair = self.pair - if pair is not None: -- copy_reg.add_extension(pair[0], pair[1], code) -+ copyreg.add_extension(pair[0], pair[1], code) - - class C: - def __cmp__(self, other): -@@ -154,8 +154,8 @@ class initarg(C): - class metaclass(type): - pass - --class use_metaclass(object): -- __metaclass__ = metaclass -+class use_metaclass(object, metaclass=metaclass): -+ pass - - class pickling_metaclass(type): - def __eq__(self, other): -@@ -430,7 +430,7 @@ def create_data(): - c = C() - c.foo = 1 - c.bar = 2 -- x = [0, 1L, 2.0, 3.0+0j] -+ x = [0, 1, 2.0, 3.0+0j] - # Append some integer test cases at cPickle.c's internal size - # cutoffs. - uint1max = 0xff -@@ -498,7 +498,7 @@ class AbstractPickleTests(unittest.TestCase): - - for proto, expected in (0, DATA0_DIS), (1, DATA1_DIS): - s = self.dumps(self._testdata, proto) -- filelike = cStringIO.StringIO() -+ filelike = io.StringIO() - dis(s, out=filelike) - got = filelike.getvalue() - self.assertEqual(expected, got) -@@ -528,7 +528,7 @@ class AbstractPickleTests(unittest.TestCase): - for proto in protocols: - s = self.dumps(d, proto) - x = self.loads(s) -- self.assertEqual(x.keys(), [1]) -+ self.assertEqual(list(x.keys()), [1]) - self.assertTrue(x[1] is x) - - def test_recursive_inst(self): -@@ -551,7 +551,7 @@ class AbstractPickleTests(unittest.TestCase): - x = self.loads(s) - self.assertEqual(len(x), 1) - self.assertEqual(dir(x[0]), dir(i)) -- self.assertEqual(x[0].attr.keys(), [1]) -+ self.assertEqual(list(x[0].attr.keys()), [1]) - self.assertTrue(x[0].attr[1] is x) - - def test_garyp(self): -@@ -576,8 +576,8 @@ class AbstractPickleTests(unittest.TestCase): - - if have_unicode: - def test_unicode(self): -- endcases = [u'', u'<\\u>', u'<\\\u1234>', u'<\n>', -- u'<\\>', u'<\\\U00012345>'] -+ endcases = ['', '<\\u>', '<\\\u1234>', '<\n>', -+ '<\\>', '<\\\U00012345>'] - for proto in protocols: - for u in endcases: - p = self.dumps(u, proto) -@@ -585,7 +585,7 @@ class AbstractPickleTests(unittest.TestCase): - self.assertEqual(u2, u) - - def test_unicode_high_plane(self): -- t = u'\U00012345' -+ t = '\U00012345' - for proto in protocols: - p = self.dumps(t, proto) - t2 = self.loads(p) -@@ -594,7 +594,7 @@ class AbstractPickleTests(unittest.TestCase): - def test_ints(self): - import sys - for proto in protocols: -- n = sys.maxint -+ n = sys.maxsize - while n: - for expected in (-n, n): - s = self.dumps(expected, proto) -@@ -603,7 +603,7 @@ class AbstractPickleTests(unittest.TestCase): - n = n >> 1 - - def test_maxint64(self): -- maxint64 = (1L << 63) - 1 -+ maxint64 = (1 << 63) - 1 - data = 'I' + str(maxint64) + '\n.' - got = self.loads(data) - self.assertEqual(got, maxint64) -@@ -616,7 +616,7 @@ class AbstractPickleTests(unittest.TestCase): - for proto in protocols: - # 256 bytes is where LONG4 begins. - for nbits in 1, 8, 8*254, 8*255, 8*256, 8*257: -- nbase = 1L << nbits -+ nbase = 1 << nbits - for npos in nbase-1, nbase, nbase+1: - for n in npos, -npos: - pickle = self.dumps(n, proto) -@@ -624,7 +624,7 @@ class AbstractPickleTests(unittest.TestCase): - self.assertEqual(n, got) - # Try a monster. This is quadratic-time in protos 0 & 1, so don't - # bother with those. -- nbase = long("deadbeeffeedface", 16) -+ nbase = int("deadbeeffeedface", 16) - nbase += nbase << 1000000 - for n in nbase, -nbase: - p = self.dumps(n, 2) -@@ -661,7 +661,7 @@ class AbstractPickleTests(unittest.TestCase): - - def test_dynamic_class(self): - a = create_dynamic_class("my_dynamic_class", (object,)) -- copy_reg.pickle(pickling_metaclass, pickling_metaclass.__reduce__) -+ copyreg.pickle(pickling_metaclass, pickling_metaclass.__reduce__) - for proto in protocols: - s = self.dumps(a, proto) - b = self.loads(s) -@@ -702,14 +702,14 @@ class AbstractPickleTests(unittest.TestCase): - badpickle = pickle.PROTO + chr(oob) + build_none - try: - self.loads(badpickle) -- except ValueError, detail: -+ except ValueError as detail: - self.assertTrue(str(detail).startswith( - "unsupported pickle protocol")) - else: - self.fail("expected bad protocol number to raise ValueError") - - def test_long1(self): -- x = 12345678910111213141516178920L -+ x = 12345678910111213141516178920 - for proto in protocols: - s = self.dumps(x, proto) - y = self.loads(s) -@@ -717,7 +717,7 @@ class AbstractPickleTests(unittest.TestCase): - self.assertEqual(opcode_in_pickle(pickle.LONG1, s), proto >= 2) - - def test_long4(self): -- x = 12345678910111213141516178920L << (256*8) -+ x = 12345678910111213141516178920 << (256*8) - for proto in protocols: - s = self.dumps(x, proto) - y = self.loads(s) -@@ -847,7 +847,7 @@ class AbstractPickleTests(unittest.TestCase): - def produce_global_ext(self, extcode, opcode): - e = ExtensionSaver(extcode) - try: -- copy_reg.add_extension(__name__, "MyList", extcode) -+ copyreg.add_extension(__name__, "MyList", extcode) - x = MyList([1, 2, 3]) - x.foo = 42 - x.bar = "hello" -@@ -891,7 +891,7 @@ class AbstractPickleTests(unittest.TestCase): - - def test_list_chunking(self): - n = 10 # too small to chunk -- x = range(n) -+ x = list(range(n)) - for proto in protocols: - s = self.dumps(x, proto) - y = self.loads(s) -@@ -900,7 +900,7 @@ class AbstractPickleTests(unittest.TestCase): - self.assertEqual(num_appends, proto > 0) - - n = 2500 # expect at least two chunks when proto > 0 -- x = range(n) -+ x = list(range(n)) - for proto in protocols: - s = self.dumps(x, proto) - y = self.loads(s) -@@ -913,7 +913,7 @@ class AbstractPickleTests(unittest.TestCase): - - def test_dict_chunking(self): - n = 10 # too small to chunk -- x = dict.fromkeys(range(n)) -+ x = dict.fromkeys(list(range(n))) - for proto in protocols: - s = self.dumps(x, proto) - y = self.loads(s) -@@ -922,7 +922,7 @@ class AbstractPickleTests(unittest.TestCase): - self.assertEqual(num_setitems, proto > 0) - - n = 2500 # expect at least two chunks when proto > 0 -- x = dict.fromkeys(range(n)) -+ x = dict.fromkeys(list(range(n))) - for proto in protocols: - s = self.dumps(x, proto) - y = self.loads(s) -@@ -1025,7 +1025,7 @@ class AbstractPickleTests(unittest.TestCase): - def test_many_puts_and_gets(self): - # Test that internal data structures correctly deal with lots of - # puts/gets. -- keys = ("aaa" + str(i) for i in xrange(100)) -+ keys = ("aaa" + str(i) for i in range(100)) - large_dict = dict((k, [4, 5, 6]) for k in keys) - obj = [dict(large_dict), dict(large_dict), dict(large_dict)] - -@@ -1091,7 +1091,7 @@ class REX_three(object): - self._proto = proto - return REX_two, () - def __reduce__(self): -- raise TestFailed, "This __reduce__ shouldn't be called" -+ raise TestFailed("This __reduce__ shouldn't be called") - - class REX_four(object): - _proto = None -@@ -1117,7 +1117,7 @@ class MyInt(int): - sample = 1 - - class MyLong(long): -- sample = 1L -+ sample = 1 - - class MyFloat(float): - sample = 1.0 -@@ -1128,8 +1128,8 @@ class MyComplex(complex): - class MyStr(str): - sample = "hello" - --class MyUnicode(unicode): -- sample = u"hello \u1234" -+class MyUnicode(str): -+ sample = "hello \u1234" - - class MyTuple(tuple): - sample = (1, 2, 3) -@@ -1175,7 +1175,7 @@ class AbstractPickleModuleTests(unittest.TestCase): - os.remove(TESTFN) - - def test_load_from_and_dump_to_file(self): -- stream = cStringIO.StringIO() -+ stream = io.StringIO() - data = [123, {}, 124] - self.module.dump(data, stream) - stream.seek(0) -@@ -1187,7 +1187,7 @@ class AbstractPickleModuleTests(unittest.TestCase): - self.assertEqual(self.module.HIGHEST_PROTOCOL, 3) - - def test_callapi(self): -- f = cStringIO.StringIO() -+ f = io.StringIO() - # With and without keyword arguments - self.module.dump(123, f, -1) - self.module.dump(123, file=f, protocol=-1) -@@ -1197,7 +1197,7 @@ class AbstractPickleModuleTests(unittest.TestCase): - self.module.Pickler(f, protocol=-1) - - def test_incomplete_input(self): -- s = StringIO.StringIO("X''.") -+ s = io.StringIO("X''.") - self.assertRaises(EOFError, self.module.load, s) - - @skipIf(_is_pypy or _is_jython, "Fails to access the redefined builtins") -@@ -1207,7 +1207,7 @@ class AbstractPickleModuleTests(unittest.TestCase): - '__import__': __import__} - d = {} - teststr = "def f(): pickleme.dumps(0)" -- exec teststr in {'__builtins__': builtins}, d -+ exec(teststr, {'__builtins__': builtins}, d) - d['f']() - - def test_bad_input(self): -@@ -1242,7 +1242,7 @@ class AbstractPersistentPicklerTests(unittest.TestCase - def test_persistence(self): - self.id_count = 0 - self.load_count = 0 -- L = range(10) -+ L = list(range(10)) - self.assertEqual(self.loads(self.dumps(L)), L) - self.assertEqual(self.id_count, 5) - self.assertEqual(self.load_count, 5) -@@ -1250,7 +1250,7 @@ class AbstractPersistentPicklerTests(unittest.TestCase - def test_bin_persistence(self): - self.id_count = 0 - self.load_count = 0 -- L = range(10) -+ L = list(range(10)) - self.assertEqual(self.loads(self.dumps(L, 1)), L) - self.assertEqual(self.id_count, 5) - self.assertEqual(self.load_count, 5) -@@ -1282,7 +1282,7 @@ class AbstractPicklerUnpicklerObjectTests(unittest.Tes - # object again, the third serialized form should be identical to the - # first one we obtained. - data = ["abcdefg", "abcdefg", 44] -- f = cStringIO.StringIO() -+ f = io.StringIO() - pickler = self.pickler_class(f) - - pickler.dump(data) -@@ -1309,13 +1309,13 @@ class AbstractPicklerUnpicklerObjectTests(unittest.Tes - def test_priming_pickler_memo(self): - # Verify that we can set the Pickler's memo attribute. - data = ["abcdefg", "abcdefg", 44] -- f = cStringIO.StringIO() -+ f = io.StringIO() - pickler = self.pickler_class(f) - - pickler.dump(data) - first_pickled = f.getvalue() - -- f = cStringIO.StringIO() -+ f = io.StringIO() - primed = self.pickler_class(f) - primed.memo = pickler.memo - -@@ -1327,25 +1327,25 @@ class AbstractPicklerUnpicklerObjectTests(unittest.Tes - def test_priming_unpickler_memo(self): - # Verify that we can set the Unpickler's memo attribute. - data = ["abcdefg", "abcdefg", 44] -- f = cStringIO.StringIO() -+ f = io.StringIO() - pickler = self.pickler_class(f) - - pickler.dump(data) - first_pickled = f.getvalue() - -- f = cStringIO.StringIO() -+ f = io.StringIO() - primed = self.pickler_class(f) - primed.memo = pickler.memo - - primed.dump(data) - primed_pickled = f.getvalue() - -- unpickler = self.unpickler_class(cStringIO.StringIO(first_pickled)) -+ unpickler = self.unpickler_class(io.StringIO(first_pickled)) - unpickled_data1 = unpickler.load() - - self.assertEqual(unpickled_data1, data) - -- primed = self.unpickler_class(cStringIO.StringIO(primed_pickled)) -+ primed = self.unpickler_class(io.StringIO(primed_pickled)) - primed.memo = unpickler.memo - unpickled_data2 = primed.load() - -@@ -1356,18 +1356,18 @@ class AbstractPicklerUnpicklerObjectTests(unittest.Tes - - def test_reusing_unpickler_objects(self): - data1 = ["abcdefg", "abcdefg", 44] -- f = cStringIO.StringIO() -+ f = io.StringIO() - pickler = self.pickler_class(f) - pickler.dump(data1) - pickled1 = f.getvalue() - - data2 = ["abcdefg", 44, 44] -- f = cStringIO.StringIO() -+ f = io.StringIO() - pickler = self.pickler_class(f) - pickler.dump(data2) - pickled2 = f.getvalue() - -- f = cStringIO.StringIO() -+ f = io.StringIO() - f.write(pickled1) - f.seek(0) - unpickler = self.unpickler_class(f)