<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 17, 2013 at 2:14 PM,  <span dir="ltr"><<a href="mailto:exarkun@twistedmatrix.com" target="_blank">exarkun@twistedmatrix.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I think there are still many unported dependencies of `twistd` to port first.<br>
</blockquote><div><br></div><div>Sure, but every little bit helps, right? :)<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Can someone comment as to why this was put there in the first place, and,<br>
specifically, why it can't just be "pass"? Is there some logging system<br>
that looks at the current exception or something when twistd (or some other<br>
script) starts?<br>
</blockquote>
<br></div>
Both `log.err()´ and `Failure()´ look at the current exception.  If we don't `sys.clear_exc()´ here then the first piece of code that tries to use either of those may get a surprising result.  The current exception state can last a long time so this surprise can hide for a remarkably long time before showing up.<br>

</blockquote><div><br></div><div>Okay, cool. From what I understand:<br><br>1. _preamble is just a hack to get bin/whatever to work right without installing (i.e. from a checkout)<br></div><div>2. (not too sure about this) in py3k, except statements do the clearing bit already: <a href="http://www.python.org/dev/peps/pep-3110/#semantic-changes">www.python.org/dev/peps/pep-3110/#semantic-changes</a><br>

</div><div> <br></div><div>So, does that mean we can do a try: ... ; except AttributeError and be done with it?<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


The exception state also holds references to lots of extra things on the stack which is undesirable even if there are no other side-effects.<br>
<br>
Jean-Paul<br></blockquote><div><br></div><div>lvh <br></div></div></div></div>