-
-
Notifications
You must be signed in to change notification settings - Fork 126
Support 3.13 in PyDev.Debugger #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1077,8 +1077,9 @@ def get_file_type(self, frame, abs_real_path_and_basename=None, _cache_file_type | |||
if abs_real_path_and_basename[0] == "<string>": | |||
# Consider it an untraceable file unless there's no back frame (ignoring | |||
# internal files and runpy.py). | |||
if frame.f_back is not None and self.get_file_type(frame.f_back) == self.PYDEV_FILE: | |||
# Special case, this is a string coming from pydevd itself (or another internal file) | |||
if frame.f_back is not None and self.get_file_type(frame.f_back) == self.PYDEV_FILE and is_pydevd_path(frame.f_back.f_code.co_filename): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the change required to let '' modules from debugpy to go through. Debugpy modules are marked as PYDEV_FILES but the code they run should be marked as NONE. Only the lambdas in pydevd should be marked as PYDEV_FILE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must say I don't fully comprehend the use case... can you elaborate a bit on which use-case this happens? Maybe debugpy
itself could not use <string>
as the name to compile those in that use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it was debugpy using runpy to execute some string code. I'll have to pull this back and see which tests fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's this test here.
https://github.com/microsoft/debugpy/blob/8ab4ee89e9ae9a926f711904900a27e3c96d43d4/tests/debugpy/test_breakpoints.py#L420
It's whenever debugpy is launched with a string. That string's caller is debugpy so it goes down this path.
I'll look into maybe making pydevd's strings to be marked special instead. Then we can eliminate this code.
As I wanted to do a release I merged as is and did an additional commit: 801c446 with most things I commented about. Note that there is 1 thing I'd still like to check (in a future commit): Related to #293 (comment): I'm not sure why this is needed (I was going to revert but let it linger for now): the proper fix I guess would be making sure that in pydevd itself there'd be no modules created with |
p.s.: Thank you for the PR! |
Actually, I ended up removing that |
Fixes #291
Fixes #280
This gets 3.13 working in PyDev.Debugger. I originally made some of these changes to debugpy but there was extra work to get all of the PyDev.Debugger tests to pass.
I hope I got the workflow for the tests setup correctly. I'll fix it up if the tests don't start on 3.13. Tests did pass for 3.13 on my local machine.