From f8ec029b377e1d3dc30b069243d0af29781b3846 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 23 Dec 2016 12:41:44 +0100 Subject: [PATCH] [FIX][mail_environment][server_environment] Prevent ImportError. Fixes #488. --- mail_environment/__init__.py | 10 +++++++++- server_environment/__init__.py | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/mail_environment/__init__.py b/mail_environment/__init__.py index 89dd1478f4d..18796fef7a6 100644 --- a/mail_environment/__init__.py +++ b/mail_environment/__init__.py @@ -1,2 +1,10 @@ # -*- coding: utf-8 -*- -from . import env_mail +import logging + +_logger = logging.getLogger(__name__) + +try: + from . import env_mail +except ImportError: + _logger.info("ImportError raised while loading module.") + _logger.debug("ImportError details:", exc_info=True) diff --git a/server_environment/__init__.py b/server_environment/__init__.py index 765b02bda01..bdeb91e6062 100644 --- a/server_environment/__init__.py +++ b/server_environment/__init__.py @@ -18,4 +18,12 @@ # along with this program. If not, see . # ############################################################################## -from .serv_config import serv_config, setboolean +import logging + +_logger = logging.getLogger(__name__) + +try: + from .serv_config import serv_config, setboolean +except ImportError: + _logger.info("ImportError raised while loading module.") + _logger.debug("ImportError details:", exc_info=True)