Skip to content

BUG: Fix f_back is None handling #20965

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

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/matplotlib/backends/backend_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ def keyReleaseEvent(self, event):

def resizeEvent(self, event):
frame = sys._getframe()
if frame.f_code is frame.f_back.f_code: # Prevent PyQt6 recursion.
# Prevent PyQt6 recursion, but sometimes frame.f_back is None
if frame.f_code is getattr(frame.f_back, 'f_code', None):
return
w = event.size().width() * self.device_pixel_ratio
h = event.size().height() * self.device_pixel_ratio
Expand Down