Issue1542997
Created on 2006-08-19.06:07:58 by raptoraudio, last changed 2006-08-20.20:13:36 by cgroves.
| msg2531 (view) |
Author: Raptor Audio (raptoraudio) |
Date: 2006-08-19.06:07:58 |
|
Problem: Assertions process the message node, if passed
regardless of whether the assertion is true or false.
This behavior is not consistent with CPython.
Fix: Changed the visitAssert method to only reach the
message, if the assertion fails. Calling the Py.assert_
method was changed to compare the assertion result
after visit(node.test). If the assertion succeeds, then the
generated code will branch to the end of the method.
Otherwise, the node.msg will be processed and an
AssertionError will be raised.
Test: Below is some sample code. The code used to run
the method regardless of the assertion. The new method
will only run it if the assert fails.
def f():
print "Should only print when assert fails!"
return 1
assert 1, f()
assert 0, f()
|
| msg2532 (view) |
Author: Charlie Groves (cgroves) |
Date: 2006-08-20.20:13:36 |
|
Logged In: YES
user_id=1174327
Looks good to me. Applied in r2900.
|
|
| Date |
User |
Action |
Args |
| 2006-08-19 06:07:58 | raptoraudio | create | |
|