Skip to content

Commit

Permalink
MNT: remove commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Aug 19, 2021
1 parent 491528a commit b77a613
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions lib/matplotlib/backends/qt_compat.py
Expand Up @@ -255,58 +255,3 @@ def handle(*args):
signal.signal(signal.SIGINT, old_sigint_handler)
if handler_args is not None:
old_sigint_handler(*handler_args)

# class _maybe_allow_interrupt:
#
# def __init__(self, qt_object):
# self.interrupted_qobject = qt_object
# self.old_fd = None
# self.caught_args = None
#
# self.skip = False
# self.old_sigint_handler = signal.getsignal(signal.SIGINT)
# if self.old_sigint_handler in (None, signal.SIG_IGN, signal.SIG_DFL):
# self.skip = True
# return
#
# QAS = QtNetwork.QAbstractSocket
# self.qt_socket = QAS(QAS.TcpSocket, qt_object)
# # Create a socket pair
# self.wsock, self.rsock = socket.socketpair()
# # Let Qt listen on the one end
# self.qt_socket.setSocketDescriptor(self.rsock.fileno())
# self.wsock.setblocking(False)
# self.qt_socket.readyRead.connect(self._readSignal)
#
# def __enter__(self):
# if self.skip:
# return
#
# signal.signal(signal.SIGINT, self._handle)
# # And let Python write on the other end
# self.old_fd = signal.set_wakeup_fd(self.wsock.fileno())
#
# def __exit__(self, type, val, traceback):
# if self.skip:
# return
#
# signal.set_wakeup_fd(self.old_fd)
# signal.signal(signal.SIGINT, self.old_sigint_handler)
#
# self.wsock.close()
# self.rsock.close()
# self.qt_socket.abort()
# if self.caught_args is not None:
# self.old_sigint_handler(*self.caught_args)
#
# def _readSignal(self):
# # Read the written byte to re-arm the socket if a signal different
# # from SIGINT was caught.
# # Since a custom handler was installed for SIGINT, KeyboardInterrupt
# # is not raised here.
# self.qt_socket.readData(1)
#
# def _handle(self, *args):
# self.caught_args = args # save the caught args to call the old
# # SIGINT handler afterwards
# self.interrupted_qobject.quit()

0 comments on commit b77a613

Please sign in to comment.