From 333605e54db1eb224019eb378bb34bb72dc5d950 Mon Sep 17 00:00:00 2001 From: Ben Finney Date: Fri, 13 Aug 2021 10:53:12 +1000 Subject: [PATCH] Move a function call outside local exception handling. This call to `get_config` can raise exceptions, and it is not correct to catch any of them locally. --- HISTORY.txt | 3 ++- ipdb/__main__.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/HISTORY.txt b/HISTORY.txt index 556b977..743718a 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -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) diff --git a/ipdb/__main__.py b/ipdb/__main__.py index ff96a82..8a2c4a7 100644 --- a/ipdb/__main__.py +++ b/ipdb/__main__.py @@ -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