[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] Bug (or feature?) in sipParseArgs
From:       Donovan Rebbechi <elflord () andromeda ! rutgers ! edu>
Date:       2002-06-27 7:05:58
[Download RAW message or body]


I noticed a curious feature in sipParseArgs recently-- sometimes, it
leaves the error handler with a "dangling error" set when it returns false.
Judging by the code in parsePass1(), and the idiomatic usage in generated code
where several blocks are tried one after the other, this looks like a
mistake.  It certainly resulted in some interesting and obscure bugs in
my code ;-)

I took a look at the code (sip 3.2.4) and PyErr_Clear() is called at the
top of the loop, but not before the exit of the function, which means that
if the last loop iteration sets a python exception, the function exits in
that state.

The fix that addresses this is to call PyErr_Clear() at the end of ParsePass1()

Cheers,
-- 
Donovan

_______________________________________________
PyKDE mailing list    PyKDE@mats.gmd.de
http://mats.gmd.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic