Skip to content

Commit 738fd89

Browse files
Fix DeprecationWarning about collections.Mapping.
1 parent 4476b3c commit 738fd89

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

prompt_toolkit/styles/from_dict.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
- Support for ANSI color names. (These will map directly to the 16 terminal
77
colors.)
88
"""
9-
from collections import Mapping
9+
try:
10+
from collections.abc import Mapping
11+
except ImportError:
12+
from collections import Mapping
1013

1114
from .base import Style, DEFAULT_ATTRS, ANSI_COLOR_NAMES
1215
from .defaults import DEFAULT_STYLE_EXTENSIONS

0 commit comments

Comments
 (0)