Skip to content

Commit 6d8dbb0

Browse files
authored
blanket try-catch to ensure following unpatch code (#6385)
* blanket try-catch to ensure following unpatch code * review comments * comments
1 parent ee7b39d commit 6d8dbb0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell

src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/az_completer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,11 @@ def mute_parse_args(self, text):
205205
AzCliCommandParser.error = error_pass
206206
AzCliCommandParser._check_value = _check_value_muted
207207

208-
parse_args = self.argsfinder.get_parsed_args(
209-
parse_quotes(text, quotes=False, string=False))
208+
# No exception is expected. However, we add this try-catch block, as this may have far-reaching effects.
209+
try:
210+
parse_args = self.argsfinder.get_parsed_args(parse_quotes(text, quotes=False, string=False))
211+
except Exception: # pylint: disable=broad-except
212+
pass
210213

211214
AzCliCommandParser.error = error
212215
AzCliCommandParser._check_value = _check_value

0 commit comments

Comments
 (0)