Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d162b6d

Browse filesBrowse files
authored
Merge pull request #16311 from stevengj/patch-1
MNT: don't override non-Python signal handlers
2 parents 71a54ac + 48ddfbc commit d162b6d
Copy full SHA for d162b6d

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎lib/matplotlib/backends/backend_qt5.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt5.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,9 +1034,11 @@ def trigger_manager_draw(manager):
10341034
def mainloop():
10351035
old_signal = signal.getsignal(signal.SIGINT)
10361036
# allow SIGINT exceptions to close the plot window.
1037-
signal.signal(signal.SIGINT, signal.SIG_DFL)
1037+
if old_signal:
1038+
signal.signal(signal.SIGINT, signal.SIG_DFL)
10381039
try:
10391040
qApp.exec_()
10401041
finally:
10411042
# reset the SIGINT exception handler
1042-
signal.signal(signal.SIGINT, old_signal)
1043+
if old_signal:
1044+
signal.signal(signal.SIGINT, old_signal)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.