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