From: vsr Date: Thu, 27 Jan 2022 16:25:50 +0000 (+0300) Subject: bos #28780 EDF 24163 warnings in terminal when using salome_pluginsmanager.py X-Git-Tag: V9_9_0a1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=340f4d4b63f51d67fed071d14727fe4e1b0a9e13;p=modules%2Fgui.git bos #28780 EDF 24163 warnings in terminal when using salome_pluginsmanager.py --- 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()