From 82c9f7231decf0a993a336de2f1ddb9742afa1ec Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Fri, 23 Oct 2020 14:27:22 +0200 Subject: [PATCH] Issue an error when file name colides with internals --- src/daSalome/daGUI/ADAOGUI.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/daSalome/daGUI/ADAOGUI.py b/src/daSalome/daGUI/ADAOGUI.py index bc619be..48bb3e2 100644 --- a/src/daSalome/daGUI/ADAOGUI.py +++ b/src/daSalome/daGUI/ADAOGUI.py @@ -34,6 +34,12 @@ reasons: """ import adao +if not hasattr(adao, "adao_py_dir"): + if hasattr(adao, "__file__"): + lieu = " A potential candidate file is %s."%repr(adao.__file__) + else: + lieu = "" + raise ImportError("\n\nFailed to activate module ADAO. Is it perhaps because you own a personnal perturbating file \'adao.py\' somewhere in your PATH?%s Rename, remove or move it before retrying to launch SALOME/ADAO.\n"%lieu) from daGuiImpl import ADAOGUI_impl as GuiImpl from daUtils import adaoLogger -- 2.39.2