Skip to content

Commit 3f7f318

Browse files
committed
Apply a few tryceratops automated refactorings
1 parent 980d893 commit 3f7f318

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cmd2/cmd2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,9 +2553,9 @@ def onecmd_plus_hooks(
25532553
self.perror(f"Invalid syntax: {ex}")
25542554
except RedirectionError as ex:
25552555
self.perror(ex)
2556-
except KeyboardInterrupt as ex:
2556+
except KeyboardInterrupt:
25572557
if raise_keyboard_interrupt and not stop:
2558-
raise ex
2558+
raise
25592559
except SystemExit as ex:
25602560
if isinstance(ex.code, int):
25612561
self.exit_code = ex.code
@@ -2567,9 +2567,9 @@ def onecmd_plus_hooks(
25672567
finally:
25682568
try:
25692569
stop = self._run_cmdfinalization_hooks(stop, statement)
2570-
except KeyboardInterrupt as ex:
2570+
except KeyboardInterrupt:
25712571
if raise_keyboard_interrupt and not stop:
2572-
raise ex
2572+
raise
25732573
except SystemExit as ex:
25742574
if isinstance(ex.code, int):
25752575
self.exit_code = ex.code
@@ -4041,9 +4041,9 @@ def select(self, opts: Union[str, list[str], list[tuple[Any, Optional[str]]]], p
40414041
except EOFError:
40424042
response = ''
40434043
self.poutput()
4044-
except KeyboardInterrupt as ex:
4044+
except KeyboardInterrupt:
40454045
self.poutput('^C')
4046-
raise ex
4046+
raise
40474047

40484048
if not response:
40494049
continue

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ select = [
215215
"TC", # flake8-type-checking (type checking warnings)
216216
"TD", # flake8-todos (force all TODOs to include an author and issue link)
217217
"TID", # flake8-tidy-imports (extra import rules to check)
218-
# "TRY", # tryceratops (warnings related to exceptions and try/except)
218+
# "TRY", # tryceratops (warnings related to exceptions and try/except)
219219
"UP", # pyupgrade (A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language)
220220
"W", # pycodestyle warnings (warn about minor stylistic issues)
221221
"YTT", # flake8-2020 (checks for misuse of sys.version or sys.version_info)

0 commit comments

Comments
 (0)