Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1,

and make it 2.6-compatible.
This commit is contained in:
Antoine Pitrou 2009-02-07 17:13:31 +00:00
parent 7bf8d4ed4d
commit 8a68122e9c
7 changed files with 40 additions and 19 deletions

View file

@ -1,6 +1,12 @@
from pybench import Test
import sys
try:
intern
except NameError:
intern = sys.intern
class ConcatStrings(Test):
version = 2.0
@ -174,7 +180,7 @@ class CompareInternedStrings(Test):
def test(self):
# Make sure the strings *are* interned
s = sys.intern(''.join(map(str,range(10))))
s = intern(''.join(map(str,range(10))))
t = s
for i in range(self.rounds):
@ -240,7 +246,7 @@ class CompareInternedStrings(Test):
def calibrate(self):
s = sys.intern(''.join(map(str,range(10))))
s = intern(''.join(map(str,range(10))))
t = s
for i in range(self.rounds):