We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3992fb0 + e676ffb commit 11a3e1bCopy full SHA for 11a3e1b
lib/matplotlib/pyplot.py
@@ -329,8 +329,11 @@ def draw_if_interactive():
329
330
331
def _warn_if_gui_out_of_main_thread():
332
- if (_get_required_interactive_framework(_get_backend_mod())
333
- and threading.current_thread() is not threading.main_thread()):
+ # This compares native thread ids because even if python-level Thread
+ # objects match, the underlying OS thread (which is what really matters)
334
+ # may be different on Python implementations with green threads.
335
+ if (_get_required_interactive_framework(_get_backend_mod()) and
336
+ threading.get_native_id() != threading.main_thread().native_id):
337
_api.warn_external(
338
"Starting a Matplotlib GUI outside of the main thread will likely "
339
"fail.")
0 commit comments