diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2023-03-05 20:37:19 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2023-03-05 20:37:19 -0500 |
| commit | f55e478bf84aceb420c52dd96982d92dc7b38626 (patch) | |
| tree | 9d8b53c7dda6a19926054fa59ea20b801a772187 /setuptools/config | |
| parent | 965af23e4d5acc033bf21b7347ebf15fe9b2a62c (diff) | |
| download | python-setuptools-git-f55e478bf84aceb420c52dd96982d92dc7b38626.tar.gz | |
Trap exception directly instead of tracking with boolean.
Diffstat (limited to 'setuptools/config')
| -rw-r--r-- | setuptools/config/setupcfg.py | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/setuptools/config/setupcfg.py b/setuptools/config/setupcfg.py index b172b946..835d7314 100644 --- a/setuptools/config/setupcfg.py +++ b/setuptools/config/setupcfg.py @@ -293,18 +293,9 @@ class ConfigHandler(Generic[Target]): # Already inhabited. Skipping. return - skip_option = False - parser = self.parsers.get(option_name) - if parser: - try: - parsed = parser(value) - - except Exception: - skip_option = True - if not self.ignore_option_errors: - raise - - if skip_option: + try: + parsed = self.parsers.get(option_name, lambda x: x)(value) + except (Exception,) * self.ignore_option_errors: return setter = getattr(target_obj, 'set_%s' % option_name, None) |
