Fix set_trace(paused=False)
Previously this gave an exception like
>>> pudb._get_debugger().set_trace(paused=False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/aaronmeurer/miniconda3/lib/python3.11/site-packages/pudb/debugger.py", line 291, in set_trace
self.set_continue()
File "/Users/aaronmeurer/miniconda3/lib/python3.11/bdb.py", line 344, in set_continue
self._set_stopinfo(self.botframe, None, -1)
^^^^^^^^^^^^^
AttributeError: 'Debugger' object has no attribute 'botframe'
The fix is to always set the botframe variable, even when paused=False, because after commit 2b08f08910da00e58df736c719f11ae75bd5333c, the bdb set_continue method is used, which requires botframe to be set.
The type checker doesn't like these changes. How do I fix that? (it's kind of ironic; the type checker would have been useful if it had flagged these attributes as not being defined they way they were before, conditionally under the if paused block. But only now that they're defined unconditionally does it start to have problems)
@inducer do you know how to fix all the type checker warnings here? I'd like to get this merged.
Well, this has sent me down quite the rabbit hole, including the discovery of a typeshed bug: https://github.com/python/typeshed/pull/14502. :slightly_smiling_face:
Thanks!
Wow I don't know if I could have figured all that out.
Oh, not all of that was required, by any stretch. It's just that, somehow, adding types turns into an engaging video game if you have an LSP and see the warnings drop like flies... :)
Any chance this could be put into a release?
https://pypi.org/project/pudb/2025.1.1/