summaryrefslogtreecommitdiff
path: root/cmd2/utils.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-11 19:51:50 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-11 19:51:50 -0500
commit53e1ae69696962f544d38490a88ab2de9faa217b (patch)
tree9a5159f1a7056b12f64448fc814c28c124325ca1 /cmd2/utils.py
parent0873b4d280f1335041ced7ba336768761ebb2a5f (diff)
downloadcmd2-git-53e1ae69696962f544d38490a88ab2de9faa217b.tar.gz
Fix optional type hint
typing.OrderedDict wasn't added until Python 3.7.2; so replace with Dict.
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r--cmd2/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py
index 376e2696..e324c2f1 100644
--- a/cmd2/utils.py
+++ b/cmd2/utils.py
@@ -11,7 +11,7 @@ import sys
import threading
import unicodedata
from enum import Enum
-from typing import Any, Callable, Iterable, List, OrderedDict, Optional, TextIO, Union
+from typing import Any, Callable, Dict, Iterable, List, Optional, TextIO, Union
from . import constants
@@ -914,7 +914,7 @@ def truncate_line(line: str, max_width: int, *, tab_width: int = 4) -> str:
return truncated_buf.getvalue()
-def get_styles_in_text(text: str) -> OrderedDict[int, str]:
+def get_styles_in_text(text: str) -> Dict[int, str]:
"""
Return an OrderedDict containing all ANSI style sequences found in a string