Fix run time errors with python3.12 and pyside6 (#13337)

* Change pyopen=open expression to from builtins import open as pyopen

---------

Co-authored-by: Adrián Insaurralde Avalos <36372335+adrianinsaval@users.noreply.github.com>
This commit is contained in:
Dov Grobgeld
2024-04-30 06:28:01 +02:00
committed by GitHub
parent b9aaf131fb
commit e66e90b512
56 changed files with 161 additions and 213 deletions

View File

@@ -29,6 +29,7 @@ import datetime
import shlex
import Path.Post.Utils as PostUtils
import PathScripts.PathUtils as PathUtils
from builtins import open as pyopen
TOOLTIP = """
This is a postprocessor file for the Path workbench. It is used to
@@ -128,9 +129,7 @@ POST_OPERATION = """"""
# Tool Change commands will be inserted before a tool change
TOOL_CHANGE = """"""
# to distinguish python built-in open function from the one declared below
if open.__module__ in ["__builtin__", "io"]:
pythonopen = open
def processArguments(argstring):
@@ -290,7 +289,7 @@ def export(objectslist, filename, argstring):
print("done postprocessing.")
if not filename == "-":
gfile = pythonopen(filename, "w")
gfile = pyopen(filename, "w")
gfile.write(final)
gfile.close()