<div dir="ltr">On 29 May 2013 14:02, Dave Angel <span dir="ltr"><<a href="mailto:davea@davea.name" target="_blank">davea@davea.name</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class=""><div class="h5">On 05/29/2013 08:45 AM, Oscar Benjamin wrote:</div></div>
Joshua:  Avoid doing anything complex inside an exception handler.</blockquote><div><br></div><div>Unfortunately, Ranger (the file manager in question) wraps a lot of stuff in one big exception handler. Hence there isn't much choice. The original wasn't actually in an infinite recursion, too, but just a recursion over a large directory.</div>

<div><br></div><div>Is there a reason that Python 3 can't be made to work like Python 2 and PyPy, and -if not- should it? The catchable fail would be much nicer than just bombing the program.</div><div><br></div><div>

In the meantime the algorithm should just be reworked, but it seems like a larger step than should be needed.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

If nothing else, the exception frame is huge.  I probably would have spotted it except for the indentation problem triggered by html.  The top level code following your function didn't have any loops, so it wasn't a problem.<br>


<br>
Can anyone help Joshua put his gmail into text mode?</blockquote><div><br></div><div>I've found a new option. As a test, here's a simplified version without the property:</div><div><br></div><div><div>def loop():</div>

<div>    try:</div><div>        (lambda: None)()</div><div>    except:</div><div>        pass</div><div><br></div><div>    loop()</div><div><br></div><div>try:</div><div>    loop()</div><div>except RuntimeError:</div><div>

    pass</div></div><div><br></div><div>which is pretty much <span style="font-family:arial,sans-serif;font-size:10px">Oscar Benjamin's, but less stupid.</span></div><div><br></div></div></div></div>