diff --git a/lib/matplotlib/backends/backend_qt5.py b/lib/matplotlib/backends/backend_qt5.py index ee15bfbf369d..b2bd2d564a39 100644 --- a/lib/matplotlib/backends/backend_qt5.py +++ b/lib/matplotlib/backends/backend_qt5.py @@ -1043,11 +1043,12 @@ def trigger_manager_draw(manager): def mainloop(): old_signal = signal.getsignal(signal.SIGINT) # allow SIGINT exceptions to close the plot window. - if old_signal: + is_python_signal_handler = old_signal is not None + if is_python_signal_handler: signal.signal(signal.SIGINT, signal.SIG_DFL) try: qApp.exec_() finally: # reset the SIGINT exception handler - if old_signal: + if is_python_signal_handler: signal.signal(signal.SIGINT, old_signal)
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: