diff --git a/src/Mod/Idf/Idf.py b/src/Mod/Idf/Idf.py index 507a616197..dc847eb0f0 100644 --- a/src/Mod/Idf/Idf.py +++ b/src/Mod/Idf/Idf.py @@ -22,11 +22,15 @@ #* Milos Koutny 2010 * #***************************************************************************/ -import FreeCAD, Part, os, FreeCADGui, __builtin__ +import FreeCAD, Part, os, FreeCADGui from FreeCAD import Base from math import * import ImportGui +# to distinguish python built-in open function from the one declared here +if open.__module__ in ['__builtin__','io']: + pythonopen = open + ########################################################## # Script version dated 19-Jan-2012 # ########################################################## @@ -54,8 +58,6 @@ IDF_diag_path="/tmp" # path for output of footprint.lst and missing_models.lst # End config section do not touch code below # ######################################################################################## -pythonopen = __builtin__.open # to distinguish python built-in open function from the one declared here - def open(filename): """called when freecad opens an Emn file""" docname = os.path.splitext(os.path.basename(filename))[0]