diff --git a/tools/idf_monitor_base/console_parser.py b/tools/idf_monitor_base/console_parser.py index 960f7a93d3..559f5c6261 100644 --- a/tools/idf_monitor_base/console_parser.py +++ b/tools/idf_monitor_base/console_parser.py @@ -13,7 +13,11 @@ # limitations under the License. import textwrap -from typing import Optional + +try: + from typing import Optional +except ImportError: + pass import serial.tools.miniterm as miniterm diff --git a/tools/idf_monitor_base/output_helpers.py b/tools/idf_monitor_base/output_helpers.py index 19c151e71c..07a8c5b343 100644 --- a/tools/idf_monitor_base/output_helpers.py +++ b/tools/idf_monitor_base/output_helpers.py @@ -14,7 +14,11 @@ import sys -from typing import Optional + +try: + from typing import Optional +except ImportError: + pass # ANSI terminal codes (if changed, regular expressions in LineMatcher need to be udpated) ANSI_RED = '\033[1;31m' diff --git a/tools/idf_monitor_base/stoppable_thread.py b/tools/idf_monitor_base/stoppable_thread.py index 38f6b7a01a..886ac362f9 100644 --- a/tools/idf_monitor_base/stoppable_thread.py +++ b/tools/idf_monitor_base/stoppable_thread.py @@ -13,7 +13,11 @@ # limitations under the License. import threading -from typing import Optional + +try: + from typing import Optional +except ImportError: + pass class StoppableThread(object):