<div class="gmail_quote">On Fri, Dec 4, 2009 at 3:46 PM, Stephen Hansen <span dir="ltr"><<a href="mailto:apt.shansen@gmail.com">apt.shansen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>On Fri, Dec 4, 2009 at 7:52 AM, Victor Subervi <span dir="ltr"><<a href="mailto:victorsubervi@gmail.com" target="_blank">victorsubervi@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div> except:</div><div></div></blockquote><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div> except:<br> pass<br>
</div></blockquote><div><br>
</div><div>If you want any hope of fixing the bug, remove both of these. Really -- do not use bare excepts. </div><div><br></div><div>In the first one, it looks like you're expecting sometimes there to be an exception: that's okay. If you think an operation will produce one, its okay to catch it if you know how to handle it. But do NOT use bare excepts. Catch the actual exception you are expecting-- a KeyError maybe? ValueError? I don't know, can't tell without knowing what "fn" does.</div>
<div><br></div><div>In the second-- that bare except with a pass is doing absolutely nothing but _destroying_ any chance you have of finding out what the bug IS and fixing the bug. Remove that entire try/except: pass statement. Really. You absolutely have to do it. The only reason you have not already found and fixed this bug is that you have done this-- you can't do this and then ask us to find the bug for you. </div>
<div><br></div><div>Bare excepts are there for a reason, and there are times to use them. But those are the exception and not the rule; and the time to use a except: pass construct is NOT when you're trying to fix a bug.</div>
</div></blockquote><div><br>Right <:-}<br>I changed the "pass" to "raise" and discovered an error I "worked around" while I was trying to solve another problem...then subsequently forgot about this. You know, I'm really a poet and singer/songwriter, unfortunately that doesn't pay the bills. When will I ever learn to think in my left hemisphere like a programmer :-}<br>
Thanks,<br>V<br></div></div>