On 8/10/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
>
> >>> OTOH, IDLE ran w/o this error in p3yk...
> >> Yes. Somebody would have to study what precisely the problem is: is it
> >> that there is a None key in that dictionary, and that you must not use
> >> None as a tag name? In that case: where does the None come from?
> >> Or else: is it that you can use None as a tagname in 2.x, but can't
> >> anymore in 3.0? If so: why not?
> >
> > OK, I'll start looking at it.
>
So did I, somewhat. It looks like a genuine bug in IDLE to me: you
> can't use None as a tag name, AFAIU. I'm not quite sure why this
> doesn't cause an exception in 2.x; if I try to give a None tag
> separately (i.e. in a stand-alone program) in 2.5,
> it gives me the same exception.
In 2.x the 'tag configure None' call does indeed raise a TclError, this can
been seen by trapping calls to Tkinter_Error in _tkinter.c and outputting
the Tkapp_Result.
For some reason on py3k this TclError doesn't get caught anywhere, whilst in
2.x it either gets caught or just disappears.
This behaviour can be demonstrated with:
def config_colors(self):
for tag, cnf in self.tagdefs.items():
if cnf:
try:
self.tag_configure(tag, **cnf)
except:
sys.exit(1)
self.tag_raise('sel')
on py3k the exception is caught and execution stops
on 2.x no exception is caught and execution continues (however Tkinter_Error
is still called during Tkiner_Call execution!?)
tag_configure doesn't behave this way when used in a trivial stand-alone
program, must be some obscurity within idle.
I'm confused....
James
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com