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 cc8794a611
commit ff11cd25ee
56 changed files with 161 additions and 213 deletions

View File

@@ -22,6 +22,7 @@
# ***************************************************************************
import datetime
from builtins import open as pyopen
TOOLTIP = """
This is an example postprocessor file for the Path workbench. It is used
@@ -33,9 +34,7 @@ to GCode.
now = datetime.datetime.now()
# to distinguish python built-in open function from the one declared below
if open.__module__ in ["__builtin__", "io"]:
pythonopen = open
def export(objectslist, filename, argstring):
@@ -48,7 +47,7 @@ def export(objectslist, filename, argstring):
print("the given object is not a path")
gcode = obj.Path.toGCode()
gcode = parse(gcode)
gfile = pythonopen(filename, "w")
gfile = pyopen(filename, "w")
gfile.write(gcode)
gfile.close()