Skip to content

Commit

Permalink
Move a function call outside local exception handling.
Browse files Browse the repository at this point in the history
This call to `get_config` can raise exceptions, and it is not correct
to catch any of them locally.
  • Loading branch information
Ben Finney authored and gotcha committed Dec 13, 2022
1 parent 43a8d5e commit 333605e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
0.13.11 (unreleased)
--------------------

- Nothing changed yet.
- Better exception handling when looking for config.
[bignose-debian]


0.13.10 (2022-12-13)
Expand Down
2 changes: 1 addition & 1 deletion ipdb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def set_trace(frame=None, context=None, cond=True):


def get_context_from_config():
parser = get_config()
try:
parser = get_config()
return parser.getint("ipdb", "context")
except (configparser.NoSectionError, configparser.NoOptionError):
return 3
Expand Down

0 comments on commit 333605e

Please sign in to comment.