diff --git a/direct/src/directutil/Verify.py b/direct/src/directutil/Verify.py new file mode 100755 index 0000000000..89d41ec888 --- /dev/null +++ b/direct/src/directutil/Verify.py @@ -0,0 +1,17 @@ + + +def verify(assertion): + """ + verify() is intended to be used in place of assert where you + wish to have the assertion checked, even in release (-O) code. + """ + if not assertion: + print "\n\nverify failed:" + import sys + print " File \"%s\", line %d"%( + sys._getframe(1).f_code.co_filename, + sys._getframe(1).f_lineno) + if 1: + import pdb + pdb.set_trace() + raise AssertionError