8000 BUG: Fix f_back is None handling · matplotlib/matplotlib@486ad06 · GitHub
[go: up one dir, main page]

Skip to content

Commit 486ad06

Browse files
committed
BUG: Fix f_back is None handling
1 parent 6d56592 commit 486ad06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_qt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ def keyReleaseEvent(self, event):
333333

334334
def resizeEvent(self, event):
335335
frame = sys._getframe()
336-
56CE if frame.f_code is frame.f_back.f_code: # Prevent PyQt6 recursion.
336+
# Prevent PyQt6 recursion, but sometimes frame.f_back is None
337+
if frame.f_code is getattr(frame.f_back, 'f_code', None):
337338
return
338339
w = event.size().width() * self.device_pixel_ratio
339340
h = event.size().height() * self.device_pixel_ratio

0 commit comments

Comments
 (0)
0