From f9d041ba6b33b8be873a11501789b1478342d16a Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Wed, 8 Feb 2012 16:56:58 +0100 Subject: [PATCH] Use relative imports for acl and storage modules --- radicale/acl/__init__.py | 2 +- radicale/storage/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/radicale/acl/__init__.py b/radicale/acl/__init__.py index 3a78810..e38adce 100644 --- a/radicale/acl/__init__.py +++ b/radicale/acl/__init__.py @@ -53,5 +53,5 @@ def load(): else: PUBLIC_USERS.extend(_config_users("public_users")) PRIVATE_USERS.extend(_config_users("private_users")) - module = __import__("radicale.acl", fromlist=[acl_type]) + module = __import__("acl.%s" % acl_type, globals=globals(), level=2) return getattr(module, acl_type) diff --git a/radicale/storage/__init__.py b/radicale/storage/__init__.py index 02c0bab..aa2b33f 100644 --- a/radicale/storage/__init__.py +++ b/radicale/storage/__init__.py @@ -30,5 +30,6 @@ from radicale import config def load(): """Load list of available storage managers.""" storage_type = config.get("storage", "type") - module = __import__("radicale.storage", fromlist=[storage_type]) + module = __import__( + "storage.%s" % storage_type, globals=globals(), level=2) return getattr(module, storage_type)