Index: Lib/json/tests/test_dump.py =================================================================== --- Lib/json/tests/test_dump.py (revision 77361) +++ Lib/json/tests/test_dump.py (working copy) @@ -17,5 +17,5 @@ {True: False, False: True}, sort_keys=True), '{"false": true, "true": false}') self.assertEquals(json.dumps( - {2: 3.0, 4.0: 5L, False: 1, 6L: True, "7": 0}, sort_keys=True), - '{"false": 1, "2": 3.0, "4.0": 5, "6": true, "7": 0}') + {2: 3.0, 4.0: 5L, False: 1, 6L: True}, sort_keys=True), + '{"false": 1, "2": 3.0, "4.0": 5, "6": true}') Index: Lib/json/encoder.py =================================================================== --- Lib/json/encoder.py (revision 77361) +++ Lib/json/encoder.py (working copy) @@ -266,8 +266,6 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, _key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot, ## HACK: hand-optimized bytecode; turn globals into locals - False=False, - True=True, ValueError=ValueError, basestring=basestring, dict=dict, @@ -354,8 +352,7 @@ item_separator = _item_separator first = True if _sort_keys: - items = dct.items() - items.sort(key=lambda kv: kv[0]) + items = sorted(dct.items(), key=lambda kv: kv[0]) else: items = dct.iteritems() for key, value in items: Index: Lib/json/decoder.py =================================================================== --- Lib/json/decoder.py (revision 77361) +++ Lib/json/decoder.py (working copy) @@ -146,8 +146,9 @@ WHITESPACE = re.compile(r'[ \t\n\r]*', FLAGS) WHITESPACE_STR = ' \t\n\r' -def JSONObject((s, end), encoding, strict, scan_once, object_hook, +def JSONObject(s_and_end, encoding, strict, scan_once, object_hook, object_pairs_hook, _w=WHITESPACE.match, _ws=WHITESPACE_STR): + s, end = s_and_end pairs = [] pairs_append = pairs.append # Use a slice to prevent IndexError from being raised, the following @@ -227,7 +228,8 @@ pairs = object_hook(pairs) return pairs, end -def JSONArray((s, end), scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR): +def JSONArray(s_and_end, scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR): + s, end = s_and_end values = [] nextchar = s[end:end + 1] if nextchar in _ws: Index: Lib/sqlite3/test/types.py =================================================================== --- Lib/sqlite3/test/types.py (revision 77361) +++ Lib/sqlite3/test/types.py (working copy) @@ -231,7 +231,7 @@ sqlite.converters["FOO"] = lambda x: "[%s]" % x sqlite.converters["BAR"] = lambda x: "<%s>" % x - sqlite.converters["EXC"] = lambda x: 5/0 + sqlite.converters["EXC"] = lambda x: 5 // 0 sqlite.converters["B1B1"] = lambda x: "MARKER" def tearDown(self): Index: Lib/sqlite3/test/userfunctions.py =================================================================== --- Lib/sqlite3/test/userfunctions.py (revision 77361) +++ Lib/sqlite3/test/userfunctions.py (working copy) @@ -38,7 +38,7 @@ def func_returnblob(): return buffer("blob") def func_raiseexception(): - 5/0 + 5 // 0 def func_isstring(v): return type(v) is unicode @@ -67,7 +67,7 @@ class AggrExceptionInInit: def __init__(self): - 5/0 + 5 // 0 def step(self, x): pass @@ -80,7 +80,7 @@ pass def step(self, x): - 5/0 + 5 // 0 def finalize(self): return 42 @@ -93,7 +93,7 @@ pass def finalize(self): - 5/0 + 5 // 0 class AggrCheckType: def __init__(self): Index: Lib/sqlite3/dbapi2.py =================================================================== --- Lib/sqlite3/dbapi2.py (revision 77361) +++ Lib/sqlite3/dbapi2.py (working copy) @@ -50,7 +50,7 @@ version_info = tuple([int(x) for x in version.split(".")]) sqlite_version_info = tuple([int(x) for x in sqlite_version.split(".")]) -Binary = buffer +Binary = memoryview def register_adapters_and_converters(): def adapt_date(val): Index: Lib/test/test_sqlite.py =================================================================== --- Lib/test/test_sqlite.py (revision 77361) +++ Lib/test/test_sqlite.py (working copy) @@ -9,9 +9,14 @@ dump) def test_main(): - run_unittest(dbapi.suite(), types.suite(), userfunctions.suite(), - py25tests.suite(), factory.suite(), transactions.suite(), - hooks.suite(), regression.suite(), dump.suite()) + import warnings + with warnings.catch_warnings(): + # Silence Py3k warnings + warnings.filterwarnings("ignore", "buffer.. not supported", + DeprecationWarning) + run_unittest(dbapi.suite(), types.suite(), userfunctions.suite(), + py25tests.suite(), factory.suite(), transactions.suite(), + hooks.suite(), regression.suite(), dump.suite()) if __name__ == "__main__": test_main()