Commit 20418f31 authored by Sidnei da Silva's avatar Sidnei da Silva

- More PEP-328 changes. Make imports absolute.

parent 16688f87
......@@ -15,17 +15,18 @@
try:
from cAccessControl import rolesForPermissionOn, \
from AccessControl.cAccessControl import rolesForPermissionOn, \
PermissionRole, imPermissionRole, _what_not_even_god_should_do, \
RestrictedDTMLMixin, aq_validate, guarded_getattr, \
setDefaultBehaviors
from cAccessControl import ZopeSecurityPolicy as cZopeSecurityPolicy
from cAccessControl import SecurityManager as cSecurityManager
from AccessControl.cAccessControl import ZopeSecurityPolicy \
as cZopeSecurityPolicy
from AccessControl.cAccessControl import SecurityManager as cSecurityManager
except ImportError:
import sys
# make sure a partial import doesn't pollute sys.modules
del sys.modules[__name__]
raise
from AccessControl.ImplPython import RestrictedDTML
from AccessControl.ImplPython import SecurityManager, ZopeSecurityPolicy
......
......@@ -30,7 +30,7 @@ try:
except ImportError:
_what_not_even_god_should_do = []
from AccessControl import SecurityManagement
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl import Unauthorized
from AccessControl.interfaces import ISecurityPolicy
from AccessControl.interfaces import ISecurityManager
......@@ -721,7 +721,7 @@ def guarded_getattr(inst, name, default=_marker):
# See if we can get the value doing a filtered acquire.
# aq_acquire will either return the same value as held by
# v or it will return an Unauthorized raised by validate.
validate = SecurityManagement.getSecurityManager().validate
validate = getSecurityManager().validate
aq_acquire(inst, name, aq_validate, validate)
return v
......
......@@ -14,18 +14,18 @@
from unauthorized import Unauthorized
# This has to happen early so things get initialized properly
from Implementation import setImplementation
from AccessControl.Implementation import setImplementation
from SecurityManagement import getSecurityManager, setSecurityPolicy
from SecurityInfo import ClassSecurityInfo, ModuleSecurityInfo
from SecurityInfo import ACCESS_PRIVATE
from SecurityInfo import ACCESS_PUBLIC
from SecurityInfo import ACCESS_NONE
from SecurityInfo import secureModule, allow_module, allow_class
from SimpleObjectPolicies import allow_type
from ZopeGuards import full_write_guard, safe_builtins
from AccessControl.SecurityManagement import getSecurityManager, setSecurityPolicy
from AccessControl.SecurityInfo import ClassSecurityInfo, ModuleSecurityInfo
from AccessControl.SecurityInfo import ACCESS_PRIVATE
from AccessControl.SecurityInfo import ACCESS_PUBLIC
from AccessControl.SecurityInfo import ACCESS_NONE
from AccessControl.SecurityInfo import secureModule, allow_module, allow_class
from AccessControl.SimpleObjectPolicies import allow_type
from AccessControl.ZopeGuards import full_write_guard, safe_builtins
ModuleSecurityInfo('AccessControl').declarePublic('getSecurityManager')
import DTML
from AccessControl import DTML
del DTML
......@@ -2301,7 +2301,7 @@ void initcAccessControl(void) {
/*| from logger_wrapper import warn
*/
IMPORT(module, "logger_wrapper");
IMPORT(module, "AccessControl.logger_wrapper");
GETATTR(module, warn);
Py_DECREF(module);
module = NULL;
......
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