From b156bee57ce887a70508cf17a2dedaf90b43f4b7 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Wed, 30 Oct 2019 13:40:51 +0100 Subject: [PATCH] refactoring 2 --- moler/cmd/commandtextualgeneric.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moler/cmd/commandtextualgeneric.py b/moler/cmd/commandtextualgeneric.py index 48416d230..e2609beb8 100644 --- a/moler/cmd/commandtextualgeneric.py +++ b/moler/cmd/commandtextualgeneric.py @@ -99,10 +99,10 @@ def _build_command_string_escaped(self): self._cmd_escaped = None if self.__command_string is not None: if self._command_string_right_index != 0 or self._command_string_left_index != 0: - self._cmd_escaped = re.compile(self._build_command_string_slice()) + sub_command_string = self._build_command_string_slice() else: - sub_command_string = self.__command_string - self._cmd_escaped = re.compile(re.escape(sub_command_string)) + sub_command_string = re.escape(self.__command_string) + self._cmd_escaped = re.compile(sub_command_string) def _build_command_string_slice(self): """