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

Skip to content

Commit c3772ae

Browse files
tacaswellQuLogic
andauthored
Simplify rearming wakup socket
Co-authored-by: Elliott Sales de Andrade <[email protected]>
1 parent 9070ade commit c3772ae

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/matplotlib/backends/qt_compat.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,8 @@ def _maybe_allow_interrupt(qapp):
233233
rsock.fileno(), _enum('QtCore.QSocketNotifier.Type').Read
234234
)
235235

236-
@sn.activated.connect
237-
def on_signal(*args):
238-
rsock.recv(
239-
sys.getsizeof(int)) # clear the socket to re-arm the notifier
236+
# Clear the socket to re-arm the notifier.
237+
sn.activated.connect(lambda *args: rsock.recv(1))
240238

241239
def handle(*args):
242240
nonlocal handler_args

0 commit comments

Comments
 (0)