<div dir="ltr">All,<div><br></div><div>It seems that exceptions which occur in an event loop (when calling app.exec_(), for instance) are caught and printed, but not passed on. Is there any way to allow exceptions to propagate past exec_()? As a concrete example, the following code prints the following backtrace, but doesn't exit.</div>
<div><br></div><div><div>import sys</div><div>from PyQt4.QtCore import QTimer</div><div>from PyQt4.QtGui import QApplication</div><div><br></div><div>def af():</div><div> assert False</div><div> </div><div>def main():</div>
<div> app = QApplication(sys.argv)</div><div> QTimer.singleShot(0, af)</div><div> app.exec_()</div><div><br></div><div>if __name__ == '__main__':</div><div> main()</div><div><br></div><div><br></div><div>
Results:</div><div><div>C:\Users\bjones\Documents\enki_all\enki\tests>tst_signal2.py</div><div>Traceback (most recent call last):</div><div> File "C:\Users\bjones\Documents\enki_all\enki\tests\tst_signal2.py", line 6, in af</div>
<div> assert False</div><div>AssertionError</div></div><div><br></div><div>...but the program keeps running; I can't try/catch these in main().</div><div><br></div><div>Bryan</div>-- <br>Bryan A. Jones, Ph.D.<br>Associate Professor<br>
Department of Electrical and Computer Engineering<br>231 Simrall / PO Box 9571<br>Mississippi State University<br>Mississippi state, MS 39762<br><a href="http://www.ece.msstate.edu/~bjones" target="_blank">http://www.ece.msstate.edu/~bjones</a><br>
bjones AT ece DOT msstate DOT edu<br>voice 662-325-3149<br>fax 662-325-2298<br><br>Our Master, Jesus Christ, is on his way. He'll show up right on<br>time, his arrival guaranteed by the Blessed and Undisputed Ruler,<br>
High King, High God.<br>- 1 Tim. 6:14b-15 (The Message)<br>
</div></div>