Unify string formatting

Use one way of string formatting: replace old `%` style with new `str.format`.

Resolve #855.
This commit is contained in:
Darko Poljak 2021-03-30 07:56:38 +02:00
commit 4c2d273f07
17 changed files with 67 additions and 65 deletions

View file

@ -30,7 +30,7 @@ class AbsolutePathRequiredError(cdist.Error):
self.path = path
def __str__(self):
return 'Absolute path required, got: %s' % self.path
return 'Absolute path required, got: {}'.format(self.path)
class FileList(collections.MutableSequence):
@ -218,7 +218,7 @@ class FileBasedProperty:
def _get_attribute(self, instance, owner):
name = self._get_property_name(owner)
attribute_name = '__%s' % name
attribute_name = '__{}'.format(name)
if not hasattr(instance, attribute_name):
path = self._get_path(instance)
attribute_instance = self.attribute_class(path)