### Bug summary When I use pyplot.pause, the code hangs and I have to kill the python session. ### Code for reproduction ```python import numpy as np import matplotlib.pyplot as plt x = np.linspace(0,1,100) y = np.sin(x) z = np.cos(x) plt.plot(x,y) plt.draw() plt.pause(1) # <== hangs here plt.plot(x,z) plt.show() ``` ### Actual outcome Code hangs at `plt.pause`. ### Expected outcome Code should run fully. ### Additional information This is happening after I upgrade to sonoma 14.3 ### Operating system Mac os sonoma 14.3 ### Matplotlib Version 3.8.2 ### Matplotlib Backend MacOSX ### Python version Python 3.10.12 ### Jupyter version _No response_ ### Installation conda