Skip to content

Commit

Permalink
Resolve setter once.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 6, 2023
1 parent f55e478 commit aab7fa7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions setuptools/config/setupcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,9 @@ def __setitem__(self, option_name, value):
except (Exception,) * self.ignore_option_errors:
return

setter = getattr(target_obj, 'set_%s' % option_name, None)
if setter is None:
setattr(target_obj, option_name, parsed)
else:
setter(parsed)
simple_setter = functools.partial(target_obj.__setattr__, option_name)
setter = getattr(target_obj, 'set_%s' % option_name, simple_setter)
setter(parsed)

self.set_options.append(option_name)

Expand Down

0 comments on commit aab7fa7

Please sign in to comment.