Message41794
Logged In: YES
user_id=85414
I've attached a new patch, which implements most of
your suggestions:
o The Jump tests now have their own test case class
in test_trace.py.
o There's now a test for "lineno must be an integer".
o I've added your nested-finally-jump test.
o I've added a test for each of the four (four!! 8-)
types of 'except' line.
o I've clarified the docs. I don't have a machine
to build them on - are you in a position to check
that they build and look sensible?
o Jumps fail if the frame has no trace function set,
and there's a new test in test_trace.py for that.
o pdb complains if you try to do a jump in any frame
other than the bottom one.
I'd have liked frame_setlineno to police the fact
that you can only jump in the bottom frame of a trace,
but I couldn't figure out how to do that. It would
have implemented the final two points above in one go.
As far as I can see, you're right that you can't get
frame objects or set trace functions in restricted
mode. It would be trivial to reject writes to
f_lineno in restricted mode (frame objects have an
f_restricted flag that frame_setlineno could look at)
but given that it would be impossible to test, I
haven't implemented it.
I don't get any char / unsigned char warnings under
MSVC6 (even on the highest warning level). I've made
a guess at where they might be and 'fixed' them, but
I'd be grateful if you could check, and fix them if
they're still there.
I had a go at writing the finally-policing code in
pseudo-python, but it didn't come out significantly
simpler than the C - it has to work the same way as
the C in order to be useful, but that makes it pretty
much the same. Hopefully the comment explains the
workings sufficiently well.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:18:34 | admin | link | issue643835 messages |
2007-08-23 15:18:34 | admin | create | |
|