Skip to content

Commit

Permalink
Replace deprecated logging.warn with logging.warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Feb 13, 2024
1 parent d1dfff5 commit 5d4115b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/AccessControl/SecurityInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/AccessControl/cAccessControl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/AccessControl/logger_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@


LOG = getLogger('AccessControl')
warn = LOG.warn
warn = LOG.warning

0 comments on commit 5d4115b

Please sign in to comment.