From c1d77c04d5a2dd5efe129228e596d2932366e465 Mon Sep 17 00:00:00 2001 From: Sergio Oliveira Date: Tue, 15 Sep 2015 10:40:52 -0300 Subject: [PATCH] Fixing plugins path --- colab/utils/conf.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/colab/utils/conf.py b/colab/utils/conf.py index fae27ef..b15a910 100644 --- a/colab/utils/conf.py +++ b/colab/utils/conf.py @@ -27,9 +27,8 @@ class DatabaseUndefined(ImproperlyConfigured): def _load_py_file(py_path, path): - original_path = sys.path - sys.path = [path] + sys.path.insert(0, path) try: py_settings = importlib.import_module(py_path) @@ -44,7 +43,10 @@ def _load_py_file(py_path, path): raise InaccessibleSettings(msg) finally: - sys.path = original_path + # We did not catch the ValueError on purpose + # If the imported module change the path + # we want to raise ValueError + sys.path.remove(path) py_setting = {var: getattr(py_settings, var) for var in dir(py_settings) if not var.startswith('__')} -- libgit2 0.21.2