|MrRagga||hi, how can i pass arguments to the constructor of a TestCase (unittest) ?|
|tkp||something is modifying the exit status. I can clearly see the code doing exit(2). Yet I get back a 0 in $? :(|
|ayaz||tkp: there's the queue module with threading to pass messages behind, but i don't think that would apply to your case.|
|irvin||which is easier to learn for a newbie: wxpython or pygtk+glade?|
|ayaz||tkp: you could get myscript.py to set up some env variable right before the call to sys.exit.|
and then test that variable from the other code to rule out it being a shell/env problem.
|tkp||ayaz: think I see why...|
no idea why they would do that tho?
|ayaz||um, so, there's a possiblity, like you said, of something masking the SystemExit and exiting properly.|
which might explain the 0 in the exit status
|tkp||I think that does explan it...|
I just don't understand why they would do that
|ayaz||that's the only thing that comes to mind.|
defeats the purpose, i know.
tkp: i think whoever wrote that script didn't really know what they were doing with catching SystemExit there.
|tkp||/ Capture the text of any other exception that's raised by the interpreter|
/ into a StringIO buffer for later extraction.
look t that past again... When a SystemExit is caught... with it exit with 0, or will the next except: block be run?
if a SystemExit is caught, sys.exit(0) over there will be run
the script with exit gracefully.
|tkp||hmm... that really odd|
|ayaz||i think the author meant to catch some other exception.|
|tkp||why would you want that? doesn't make any sence to me|
|ayaz||yeah. it doesn't, at all.|
|tkp||I've seen this done elsewhere|
search for SystemExit
|ayaz||there is one that masks a SystemExit with a 'pass'|
|tkp||(from another place in the same app I'm using)|
oh yeah! this one too
|ayaz||this one avoid SystemExit|
|tkp||perhaps thats what they meant to do|
|ayaz||the pass will mask the SystemExit (rendering the call to sys.exit(0) ineffective) and continue on with further processing.|
|veracon_||Anyone familiar with reST know if I can indent the names of a definition list slightly, then indenting the definitions more (and still retain a valid markup)?|