Fix matplotlib backend computation#1811
Merged
rchiodo merged 2 commits intomicrosoft:mainfrom Jan 15, 2025
Merged
Conversation
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
rchiodo
commented
Jan 15, 2025
| assert frame.f_code is code_obj | ||
|
|
||
| func_code_info.filtered_out_force_checked = py_db.apply_files_filter(frame, func_code_info.abs_path_filename, py_db.get_use_libraries_filter()) | ||
| func_code_info.filtered_out_force_checked = py_db.apply_files_filter(frame, func_code_info.abs_path_filename, True) |
Contributor
Author
There was a problem hiding this comment.
This needs to be True as this flag is used elsewhere. However always_filtered_out should be determined by whether or not the file is filtered (which it isn't when justMyCode = false)
rchiodo
commented
Jan 15, 2025
| info.pydev_step_cmd == CMD_STEP_INTO_MY_CODE | ||
| and frame.f_back is not None | ||
| and not py_db.apply_files_filter(frame.f_back, frame.f_back.f_code.co_filename, py_db.get_use_libraries_filter()) | ||
| and not py_db.apply_files_filter(frame.f_back, frame.f_back.f_code.co_filename, True) |
Contributor
Author
There was a problem hiding this comment.
This needed to go back to true. My original change was incorrect.
rchiodo
commented
Jan 15, 2025
|
|
||
| if py_db.is_files_filter_enabled: | ||
| func_code_info.always_filtered_out = func_code_info.filtered_out_force_checked | ||
| func_code_info.always_filtered_out = py_db.apply_files_filter(frame, func_code_info.abs_path_filename, False) |
Contributor
Author
There was a problem hiding this comment.
always_filtered_out needs to recheck that the file is actually always filtered out. justMyCode would have to be true or it would have to match the exclusion filters if it's not in the user's project.
rchiodo
commented
Jan 15, 2025
|
|
||
| # Translate to the real case as in 3.9 the case was forced to lowercase | ||
| # but our internal mapping is in the original case. | ||
| realcase_backend = lowercase_convert.get(backend, backend) |
Contributor
Author
There was a problem hiding this comment.
This is what fixes the problem with matplotlib 3.9 and above.
AdamYoblick
approved these changes
Jan 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #1633
Matplotlib in 3.9 changed how they identify their backend to not be case sensitive anymore. They were always returning a lower case backend name.
Our internal code relies on the casing to find the appropriate gui. I modified the code to turn the non cased version into the cased version so the rest of our code works again.
Tested with Matplotlib 3.10 and 3.8
While running pydevd tests also noticed a problem with the fix I made for just my code. Fixed that fix as well so that all the pydevd tests pass again and the just my code fix still applies.