Index: Tools/pybench/pybench.py =================================================================== --- Tools/pybench/pybench.py (revision 82259) +++ Tools/pybench/pybench.py (working copy) @@ -415,7 +415,7 @@ # Timer used for the benchmark timer = TIMER_PLATFORM_DEFAULT - def __init__(self, name, verbose=None, timer=None, warp=None, + def __init__(self, name=None, verbose=None, timer=None, warp=None, calibration_runs=None): if name: Index: Tools/pybench/Unicode.py =================================================================== --- Tools/pybench/Unicode.py (revision 82259) +++ Tools/pybench/Unicode.py (working copy) @@ -1,5 +1,5 @@ try: - unicode + str except NameError: raise ImportError @@ -14,8 +14,8 @@ def test(self): # Make sure the strings are *not* interned - s = unicode(u''.join(map(str,range(100)))) - t = unicode(u''.join(map(str,range(1,101)))) + s = str(''.join(map(str,list(range(100))))) + t = str(''.join(map(str,list(range(1,101))))) for i in range(self.rounds): t + s @@ -80,8 +80,8 @@ def calibrate(self): - s = unicode(u''.join(map(str,range(100)))) - t = unicode(u''.join(map(str,range(1,101)))) + s = str(''.join(map(str,list(range(100))))) + t = str(''.join(map(str,list(range(1,101))))) for i in range(self.rounds): pass @@ -96,8 +96,8 @@ def test(self): # Make sure the strings are *not* interned - s = unicode(u''.join(map(str,range(10)))) - t = unicode(u''.join(map(str,range(10))) + "abc") + s = str(''.join(map(str,list(range(10))))) + t = str(''.join(map(str,list(range(10)))) + "abc") for i in range(self.rounds): t < s @@ -162,8 +162,8 @@ def calibrate(self): - s = unicode(u''.join(map(str,range(10)))) - t = unicode(u''.join(map(str,range(10))) + "abc") + s = str(''.join(map(str,list(range(10))))) + t = str(''.join(map(str,list(range(10)))) + "abc") for i in range(self.rounds): pass @@ -178,65 +178,65 @@ def test(self): for i in range(self.rounds): - s = u'om' - s = s + u'xbx' - s = s + u'xcx' - s = s + u'xdx' - s = s + u'xex' + s = 'om' + s = s + 'xbx' + s = s + 'xcx' + s = s + 'xdx' + s = s + 'xex' - s = s + u'xax' - s = s + u'xbx' - s = s + u'xcx' - s = s + u'xdx' - s = s + u'xex' + s = s + 'xax' + s = s + 'xbx' + s = s + 'xcx' + s = s + 'xdx' + s = s + 'xex' - s = s + u'xax' - s = s + u'xbx' - s = s + u'xcx' - s = s + u'xdx' - s = s + u'xex' + s = s + 'xax' + s = s + 'xbx' + s = s + 'xcx' + s = s + 'xdx' + s = s + 'xex' - s = s + u'xax' - s = s + u'xbx' - s = s + u'xcx' - s = s + u'xdx' - s = s + u'xex' + s = s + 'xax' + s = s + 'xbx' + s = s + 'xcx' + s = s + 'xdx' + s = s + 'xex' - s = s + u'xax' - s = s + u'xbx' - s = s + u'xcx' - s = s + u'xdx' - s = s + u'xex' + s = s + 'xax' + s = s + 'xbx' + s = s + 'xcx' + s = s + 'xdx' + s = s + 'xex' - s = s + u'xax' - s = s + u'xbx' - s = s + u'xcx' - s = s + u'xdx' - s = s + u'xex' + s = s + 'xax' + s = s + 'xbx' + s = s + 'xcx' + s = s + 'xdx' + s = s + 'xex' - s = s + u'xax' - s = s + u'xbx' - s = s + u'xcx' - s = s + u'xdx' - s = s + u'xex' + s = s + 'xax' + s = s + 'xbx' + s = s + 'xcx' + s = s + 'xdx' + s = s + 'xex' - s = s + u'xax' - s = s + u'xbx' - s = s + u'xcx' - s = s + u'xdx' - s = s + u'xex' + s = s + 'xax' + s = s + 'xbx' + s = s + 'xcx' + s = s + 'xdx' + s = s + 'xex' - s = s + u'xax' - s = s + u'xbx' - s = s + u'xcx' - s = s + u'xdx' - s = s + u'xex' + s = s + 'xax' + s = s + 'xbx' + s = s + 'xcx' + s = s + 'xdx' + s = s + 'xex' - s = s + u'xax' - s = s + u'xbx' - s = s + u'xcx' - s = s + u'xdx' - s = s + u'xex' + s = s + 'xax' + s = s + 'xbx' + s = s + 'xcx' + s = s + 'xdx' + s = s + 'xex' def calibrate(self): @@ -252,7 +252,7 @@ def test(self): - s = unicode(u''.join(map(str,range(100)))) + s = str(''.join(map(str,list(range(100))))) for i in range(self.rounds): @@ -298,7 +298,7 @@ def calibrate(self): - s = unicode(u''.join(map(str,range(100)))) + s = str(''.join(map(str,list(range(100))))) for i in range(self.rounds): pass @@ -313,10 +313,10 @@ def test(self): - s = u''.join(map(unichr,range(20))) - t = u''.join(map(unichr,range(100))) - u = u''.join(map(unichr,range(500))) - v = u''.join(map(unichr,range(1000))) + s = ''.join(map(chr,list(range(20)))) + t = ''.join(map(chr,list(range(100)))) + u = ''.join(map(chr,list(range(500)))) + v = ''.join(map(chr,list(range(1000)))) for i in range(self.rounds): @@ -370,10 +370,10 @@ def calibrate(self): - s = u''.join(map(unichr,range(20))) - t = u''.join(map(unichr,range(100))) - u = u''.join(map(unichr,range(500))) - v = u''.join(map(unichr,range(1000))) + s = ''.join(map(chr,list(range(20)))) + t = ''.join(map(chr,list(range(100)))) + u = ''.join(map(chr,list(range(500)))) + v = ''.join(map(chr,list(range(1000)))) for i in range(self.rounds): pass @@ -386,7 +386,7 @@ def test(self): - data = (u'abc', u'123', u' ', u'\u1234\u2345\u3456', u'\uFFFF'*10) + data = ('abc', '123', ' ', '\u1234\u2345\u3456', '\uFFFF'*10) len_data = len(data) for i in range(self.rounds): @@ -444,7 +444,7 @@ def calibrate(self): - data = (u'abc', u'123', u' ', u'\u1234\u2345\u3456', u'\uFFFF'*10) + data = ('abc', '123', ' ', '\u1234\u2345\u3456', '\uFFFF'*10) len_data = len(data) for i in range(self.rounds): @@ -463,7 +463,7 @@ def test(self): - data = (u'a', u'1', u' ', u'\u1234', u'\uFFFF') + data = ('a', '1', ' ', '\u1234', '\uFFFF') len_data = len(data) digit = unicodedata.digit numeric = unicodedata.numeric @@ -525,7 +525,7 @@ def calibrate(self): - data = (u'a', u'1', u' ', u'\u1234', u'\uFFFF') + data = ('a', '1', ' ', '\u1234', '\uFFFF') len_data = len(data) digit = unicodedata.digit numeric = unicodedata.numeric Index: Modules/_pickle.c =================================================================== --- Modules/_pickle.c (revision 82259) +++ Modules/_pickle.c (working copy) @@ -3547,7 +3547,7 @@ if (len < 2) return bad_readline(); class_name = PyUnicode_DecodeASCII(s, len - 1, "strict"); - if (class_name == NULL) { + if (class_name != NULL) { cls = find_class(self, module_name, class_name); Py_DECREF(class_name); }