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

Skip to content

Commit 65e9204

Browse files
authored
Merge pull request #23073 from greglucas/rm-dummy-threading
MNT: Remove dummy_threading because threading is always available
2 parents fbcfea4 + 11b1260 commit 65e9204

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

lib/matplotlib/backends/backend_agg.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@
2121
.. _Anti-Grain Geometry: http://agg.sourceforge.net/antigrain.com
2222
"""
2323

24-
try:
25-
import threading
26-
except ImportError:
27-
import dummy_threading as threading
2824
from contextlib import nullcontext
2925
from math import radians, cos, sin
26+
import threading
3027

3128
import numpy as np
3229

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@
3636
import re
3737
import subprocess
3838
import sys
39-
try:
40-
import threading
41-
from threading import Timer
42-
except ImportError:
43-
import dummy_threading as threading
44-
from dummy_threading import Timer
39+
import threading
4540

4641
import matplotlib as mpl
4742
from matplotlib import _api, _afm, cbook, ft2font, rcParams
@@ -1100,7 +1095,7 @@ def __init__(self, size=None, weight='normal'):
11001095
self.ttflist = []
11011096

11021097
# Delay the warning by 5s.
1103-
timer = Timer(5, lambda: _log.warning(
1098+
timer = threading.Timer(5, lambda: _log.warning(
11041099
'Matplotlib is building the font cache; this may take a moment.'))
11051100
timer.start()
11061101
try:

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,8 @@
4343
from numbers import Number
4444
import re
4545
import sys
46+
import threading
4647
import time
47-
try:
48-
import threading
49-
except ImportError:
50-
import dummy_threading as threading
5148

5249
from cycler import cycler
5350
import matplotlib

0 commit comments

Comments
 (0)