another minor optional change: you could move the ``break`` up to right after line 97, I think.  If you combine that with my suggestion about ``else``, you can also drop the ``resp = None``.