diff --git a/src/AccessControl/SecurityInfo.py b/src/AccessControl/SecurityInfo.py index ed87984..a025d8a 100644 --- a/src/AccessControl/SecurityInfo.py +++ b/src/AccessControl/SecurityInfo.py @@ -78,7 +78,8 @@ def __init__(self): def _setaccess(self, names, access): for name in names: if self.names.get(name, access) != access: - LOG.warn('Conflicting security declarations for "%s"' % name) + LOG.warning( + f'Conflicting security declarations for {name!r}') self._warnings = 1 self.names[name] = access @@ -159,8 +160,8 @@ def setPermissionDefault(self, permission_name, roles): for role in roles: rdict[role] = 1 if self.roles.get(permission_name, rdict) != rdict: - LOG.warn('Conflicting default role' - 'declarations for permission "%s"' % permission_name) + LOG.warning('Conflicting default role' + ' declarations for permission "%s"' % permission_name) self._warnings = 1 self.roles[permission_name] = rdict @@ -248,8 +249,8 @@ def apply(self, classobj): access) if getattr(self, '_warnings', None): - LOG.warn('Class "%s" had conflicting ' - 'security declarations' % classobj.__name__) + LOG.warning('Class "%s" had conflicting' + ' security declarations' % classobj.__name__) class ClassSecurityInformation(ClassSecurityInfo): @@ -343,8 +344,8 @@ def apply(self, dict): dict['__allow_access_to_unprotected_subobjects__'] = self if getattr(self, '_warnings', None): - LOG.warn('Module "%s" had conflicting ' - 'security declarations' % dict['__name__']) + LOG.warning('Module "%s" had conflicting' + ' security declarations' % dict['__name__']) declareProtected__roles__ = ACCESS_PRIVATE diff --git a/src/AccessControl/cAccessControl.c b/src/AccessControl/cAccessControl.c index 33e763b..f733585 100644 --- a/src/AccessControl/cAccessControl.c +++ b/src/AccessControl/cAccessControl.c @@ -1071,7 +1071,7 @@ static PyObject *ZopeSecurityPolicy_validate(PyObject *self, PyObject *args) { **| try: **| if roles is None or 'Anonymous' in roles: return 1 **| except TypeError: - **| LOG.warn('"%s' passed as roles" + **| LOG.warning('"%s' passed as roles" **| " during validation of '%s' is not a sequence." % **| ('roles', name)) **| raise diff --git a/src/AccessControl/logger_wrapper.py b/src/AccessControl/logger_wrapper.py index bf1e6ab..8f3c809 100644 --- a/src/AccessControl/logger_wrapper.py +++ b/src/AccessControl/logger_wrapper.py @@ -5,4 +5,4 @@ LOG = getLogger('AccessControl') -warn = LOG.warn +warn = LOG.warning