From b77a613b3e3e612f8922920c868a1eaabe77a0ef Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 6 Aug 2021 20:11:04 -0400 Subject: [PATCH] MNT: remove commented out code --- lib/matplotlib/backends/qt_compat.py | 55 ---------------------------- 1 file changed, 55 deletions(-) diff --git a/lib/matplotlib/backends/qt_compat.py b/lib/matplotlib/backends/qt_compat.py index e3b7a28c7bef..87a330f03b69 100644 --- a/lib/matplotlib/backends/qt_compat.py +++ b/lib/matplotlib/backends/qt_compat.py @@ -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()