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

Skip to content

Commit 23c9542

Browse files
authored
Merge pull request #11262 from mdboom/optional-threading
Use dummy_threading if threading not available
2 parents 6017a93 + bc6c52c commit 23c9542

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/matplotlib/backends/backend_agg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
* integrate screen dpi w/ ppi and text
2020
2121
"""
22-
import threading
22+
try:
23+
import threading
24+
except ImportError:
25+
import dummy_threading as threading
2326
import numpy as np
2427
from collections import OrderedDict
2528
from math import radians, cos, sin

lib/matplotlib/font_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@
3939
from pathlib import Path
4040
import subprocess
4141
import sys
42-
from threading import Timer
42+
try:
43+
from threading import Timer
44+
except ImportError:
45+
from dummy_threading import Timer
4346
import warnings
4447

4548
from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir

0 commit comments

Comments
 (0)