Skip to content

Commit

Permalink
py3 compatibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Oct 27, 2018
1 parent b6712e2 commit 7fabfde
Show file tree
Hide file tree
Showing 18 changed files with 19 additions and 18 deletions.
3 changes: 2 additions & 1 deletion src/Mod/Arch/importJSON.py
Expand Up @@ -35,7 +35,8 @@
def translate(ctxt, txt): return txt


if open.__module__ == '__builtin__': pythonopen = open
if open.__module__ in ['__builtin__','io']:
pythonopen = open


def export(exportList, filename):
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Material/importFCMat.py
Expand Up @@ -36,7 +36,7 @@


# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/OpenSCAD/prototype.py
Expand Up @@ -11,7 +11,7 @@
from OpenSCAD2Dgeom import *
from OpenSCADUtils import *

if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open # to distinguish python built-in open function from the one declared here

def openscadmesh(doc,scadstr,objname):
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/centroid_post.py
Expand Up @@ -113,7 +113,7 @@


# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open

def processArguments(argstring):
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/dumper_post.py
Expand Up @@ -35,7 +35,7 @@
SHOW_EDITOR = True

# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/dynapath_post.py
Expand Up @@ -106,7 +106,7 @@


# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/example_post.py
Expand Up @@ -35,7 +35,7 @@


# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/example_pre.py
Expand Up @@ -44,7 +44,7 @@


# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/fablin_post.py
Expand Up @@ -91,7 +91,7 @@


# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open

def processArguments(argstring):
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/grbl_post.py
Expand Up @@ -99,7 +99,7 @@


# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/linuxcnc_post.py
Expand Up @@ -97,7 +97,7 @@
TOOL_CHANGE = ''''''

# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/opensbp_post.py
Expand Up @@ -80,7 +80,7 @@
TOOL_CHANGE = ''''''

# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open

CurrentState = {}
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/opensbp_pre.py
Expand Up @@ -55,7 +55,7 @@
SPEEDS = 'XY','Z','A','B'

# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/philips_post.py
Expand Up @@ -290,7 +290,7 @@ def mkHeader(selection):

linenr = 0 # variable has to be global because it is used by linenumberify and export

if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/rml_post.py
Expand Up @@ -39,7 +39,7 @@
import PathScripts.PostUtils as PostUtils

# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/slic3r_pre.py
Expand Up @@ -30,7 +30,7 @@
import FreeCAD

# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/post/smoothie_post.py
Expand Up @@ -108,7 +108,7 @@


# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open

def processArguments(argstring):
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Spreadsheet/importXLSX.py
Expand Up @@ -62,7 +62,7 @@
except ValueError: gui = False
else: gui = True

if open.__module__ == '__builtin__':
if open.__module__ in ['__builtin__','io']:
pythonopen = open


Expand Down

0 comments on commit 7fabfde

Please sign in to comment.