From 53e1ae69696962f544d38490a88ab2de9faa217b Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Tue, 11 Feb 2020 19:51:50 -0500 Subject: Fix optional type hint typing.OrderedDict wasn't added until Python 3.7.2; so replace with Dict. --- cmd2/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd2/utils.py') 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 -- cgit v1.2.1