From 340f4d4b63f51d67fed071d14727fe4e1b0a9e13 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 27 Jan 2022 19:25:50 +0300 Subject: [PATCH] bos #28780 EDF 24163 warnings in terminal when using salome_pluginsmanager.py --- src/SalomeApp/salome_pluginsmanager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SalomeApp/salome_pluginsmanager.py b/src/SalomeApp/salome_pluginsmanager.py index 8df655096..25276d441 100644 --- a/src/SalomeApp/salome_pluginsmanager.py +++ b/src/SalomeApp/salome_pluginsmanager.py @@ -281,7 +281,8 @@ class PluginsManager: sys.path.insert(0,directory) logger.debug("The directory %s has been added to PYTHONPATH"%directory) try: - exec(compile(open(plugins_file,'rb').read(), plugins_file, 'exec'),globals(),{}) + with open(plugins_file, 'rb') as fp: + exec(compile(fp.read(), plugins_file, 'exec'), globals(), {}) except: logger.critical("Error while loading plugins from file %s"%plugins_file) traceback.print_exc() -- 2.39.2