From c9a802418a2c77f786ca043c82a08eef0ae0ea29 Mon Sep 17 00:00:00 2001 From: bdieterm Date: Sat, 9 Sep 2023 12:59:11 +0200 Subject: [PATCH] Core, Gui: allow breakpoints in Init.py and InitGui.py of mods --- src/App/FreeCADInit.py | 4 ++-- src/Gui/FreeCADGuiInit.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App/FreeCADInit.py b/src/App/FreeCADInit.py index bb09e479e7..f2a80ed777 100644 --- a/src/App/FreeCADInit.py +++ b/src/App/FreeCADInit.py @@ -178,8 +178,8 @@ def InitApplications(): InstallFile = os.path.join(Dir,"Init.py") if (os.path.exists(InstallFile)): try: - with open(file=InstallFile, encoding="utf-8") as f: - exec(f.read()) + with open(InstallFile, 'rt', encoding='utf-8') as f: + exec(compile(f.read(), InstallFile, 'exec')) except Exception as inst: Log('Init: Initializing ' + Dir + '... failed\n') Log('-'*100+'\n') diff --git a/src/Gui/FreeCADGuiInit.py b/src/Gui/FreeCADGuiInit.py index 84cebe5689..5f176d78ac 100644 --- a/src/Gui/FreeCADGuiInit.py +++ b/src/Gui/FreeCADGuiInit.py @@ -132,8 +132,8 @@ def InitApplications(): InstallFile = os.path.join(Dir,"InitGui.py") if os.path.exists(InstallFile): try: - with open(file=InstallFile, encoding="utf-8") as f: - exec(f.read()) + with open(InstallFile, 'rt', encoding='utf-8') as f: + exec(compile(f.read(), InstallFile, 'exec')) except Exception as inst: Log('Init: Initializing ' + Dir + '... failed\n') Log('-'*100+'\n')