1 from pybench
import Test
3 class TryRaiseExcept(Test
):
13 for i
in xrange(self
.rounds
):
23 raise error
,"something"
27 raise error
,"something"
31 raise error
,"something"
35 raise error("something")
39 raise error("something")
43 raise error("something")
51 for i
in xrange(self
.rounds
):
55 class TryExcept(Test
):
63 for i
in xrange(self
.rounds
):
690 for i
in xrange(self
.rounds
):
693 ### Test to make Fredrik happy...
695 if __name__
== '__main__':
697 timeit
.TestClass
= TryRaiseExcept
698 timeit
.main(['-s', 'test = TestClass(); test.rounds = 1000',