Convert formatting automatically to f-strings
Automatically convert formatting with the following call: flynt -ll 2000 -v frappy* Result: 303/381 auto-converted. Failing conversions will be looked at manually in a follow-up commit. Change-Id: Icd996b27221202faccc15af78e0380cf52ee37f2 Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/30900 Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de> Reviewed-by: Georg Brandl <g.brandl@fz-juelich.de> Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
@@ -87,7 +87,7 @@ class Handler:
|
||||
if (func.__module__, func.__qualname__) in self.method_names:
|
||||
# make sure method name is not used twice
|
||||
# (else __set_name__ will not be called)
|
||||
raise ProgrammingError('duplicate method %r' % func.__qualname__)
|
||||
raise ProgrammingError(f'duplicate method {func.__qualname__!r}')
|
||||
self.func = func
|
||||
func.wrapped = False
|
||||
self.method_names.add((func.__module__, func.__qualname__))
|
||||
@@ -113,8 +113,8 @@ class Handler:
|
||||
wrapped.poll = getattr(wrapped, 'poll', self.poll)
|
||||
func = getattr(owner, method_name, None)
|
||||
if func and method_name in owner.__dict__:
|
||||
raise ProgrammingError('superfluous method %s.%s (overwritten by %s)'
|
||||
% (owner.__name__, method_name, self.__class__.__name__))
|
||||
raise ProgrammingError(f'superfluous method {owner.__name__}.' \
|
||||
f'{method_name} (overwritten by {self.__class__.__name__})')
|
||||
setattr(owner, method_name, wrapped)
|
||||
|
||||
def wrap(self, key):
|
||||
|
||||
Reference in New Issue
Block a user