Commit accf13dd authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: pylint: Fix no-name-in-module on AccessControl.PermissionRole.

This is an empty modules whose names are dynamically inserted by
AccessControl.Implementation.
parent 0d2bd4c0
Pipeline #7386 failed with stage
in 0 seconds
......@@ -224,5 +224,34 @@ def _getattr(self, name, *args, **kw):
return [ast]
Module.getattr = _getattr
from astroid import register_module_extender
def AccessControl_PermissionRole_transform():
return AstroidBuilder(MANAGER).string_build('''
def rolesForPermissionOn(perm, object, default=_default_roles, n=None):
return None
class PermissionRole(object):
def __init__(self, name, default=('Manager',)):
return None
def __of__(self, parent):
return None
def rolesForPermissionOn(self, value):
return None
class imPermissionRole(object):
def __of__(self, value):
return None
def rolesForPermissionOn(self, value):
return None
def __getitem__(self, i):
return None
def __len__(self):
return None
_what_not_even_god_should_do = []
''')
register_module_extender(MANAGER, 'AccessControl.PermissionRole',
AccessControl_PermissionRole_transform)
if sys.modules['isort'] is None:
del sys.modules['isort']
......@@ -2231,6 +2231,9 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed
class FooBar(ValidationFailed):
def __init__(self, *args, **kw):
super(FooBar, self).__init__(*args, **kw)
# Transforms for Zope which should ideally be upstream'ed
from AccessControl.PermissionRole import rolesForPermissionOn, PermissionRole, imPermissionRole, _what_not_even_god_should_do # pylint: disable=unused-import
""" % (dict(namespace=namespace,
reference1=imported_reference1,
module2=imported_module2,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment