From 9a6bb7aaa6fb0c8a9c1a841d4603f7e810f00bdc Mon Sep 17 00:00:00 2001 From: sliptonic Date: Mon, 19 Dec 2022 15:06:44 -0600 Subject: [PATCH] Fixes #7834 remove deprecated python 2.7 code --- src/Mod/Path/Path/Post/Processor.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Mod/Path/Path/Post/Processor.py b/src/Mod/Path/Path/Post/Processor.py index c80bebaa46..64573a0dcc 100644 --- a/src/Mod/Path/Path/Post/Processor.py +++ b/src/Mod/Path/Path/Post/Processor.py @@ -22,6 +22,7 @@ import Path import sys +from importlib import reload Path.Log.setLevel(Path.Log.Level.INFO, Path.Log.thisModule()) @@ -50,14 +51,8 @@ class PostProcessor: # should the script have been imported for the first time above # then the initialization code of the script gets executed twice # resulting in 2 load messages if the script outputs one of those. - try: - # Python 2.7 - exec("reload(%s)" % "current_post") - except NameError: - # Python 3.4+ - from importlib import reload - exec("reload(%s)" % "current_post") + exec("reload(%s)" % "current_post") sys.path = syspath