Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4cf1bb7

Browse files
authored
Merge pull request #20967 from meeseeksmachine/auto-backport-of-pr-20965-on-v3.5.x
Backport PR #20965 on branch v3.5.x (BUG: Fix f_back is None handling)
2 parents 1dff078 + dc09ae6 commit 4cf1bb7

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-
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)