It's sort of a borderline case, but if a mouse callback is set or a
trackbar created for a non-existent window, it currently generates a
KeyError trying to update the _windows_callbacks cache.
The underlying highgui functions do not fail in such a case, silently
ignoring the request, so this patch mirrors that behavior. I suppose
there's also a small realm of possibility of having Python code in the same
process as C code where the Python code wants to reference a window created
in the C code (and thus not known to highgui.py).
The other possibility would be to raise a Python-specific exception if it
got a window name it knew it didn't create. But I think either this patch
or a specific exception would be better than a KeyError on an internal
object to the module, which isn't going to make sense to a user.
-- David
Original issue reported on code.google.com by db3l.em...@gmail.com on 12 Jan 2009 at 9:14
Original issue reported on code.google.com by
db3l.em...@gmail.com
on 12 Jan 2009 at 9:14Attachments: