From 0ede39c2e61464446fb835e1990543ff50250716 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Wed, 24 Jan 2024 13:48:27 +0100 Subject: [PATCH] Union --- moler/cmd/commandtextualgeneric.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moler/cmd/commandtextualgeneric.py b/moler/cmd/commandtextualgeneric.py index bf98963b0..df5082da0 100644 --- a/moler/cmd/commandtextualgeneric.py +++ b/moler/cmd/commandtextualgeneric.py @@ -20,7 +20,7 @@ from moler.abstract_moler_connection import AbstractMolerConnection from moler.runner import ConnectionObserverRunner from threading import Lock -from typing import Optional, Pattern +from typing import Optional, Pattern, Union r_default_prompt: str = r'^[^<]*[$%#>~]\s*$' # When user provides no prompt @@ -33,7 +33,7 @@ class CommandTextualGeneric(Command): _re_default_prompt = re.compile(r_default_prompt) # When user provides no prompt _default_newline_chars = ("\n", "\r") # New line chars on device, not system with script! - def __init__(self, connection: Optional[AbstractMolerConnection], prompt: Optional[str | Pattern] = None, newline_chars: Optional[list | tuple] = None, runner: Optional[ConnectionObserverRunner] = None): + def __init__(self, connection: Optional[AbstractMolerConnection], prompt: Optional[Union[str, Pattern]] = None, newline_chars: Optional[Union[list, tuple]] = None, runner: Optional[ConnectionObserverRunner] = None): """ Base class for textual commands.