Kill execfile(), use exec() instead
diff --git a/Mac/Modules/file/filescan.py b/Mac/Modules/file/filescan.py
index 8ebc69f..b7c5d12 100644
--- a/Mac/Modules/file/filescan.py
+++ b/Mac/Modules/file/filescan.py
@@ -18,7 +18,7 @@
scanner.close()
scanner.gentypetest(SHORT+"typetest.py")
print "=== Testing definitions output code ==="
- execfile(defsoutput, {}, {})
+ exec(open(defsoutput).read(), {}, {})
print "=== Done scanning and generating, now importing the generated code... ==="
exec "import " + SHORT + "support"
print "=== Done. It's up to you to compile it now! ==="
diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py
index 37aeb50..de45ed4 100644
--- a/Mac/Modules/file/filesupport.py
+++ b/Mac/Modules/file/filesupport.py
@@ -340,7 +340,7 @@
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSRef, PyMac_GetFSRef);
"""
-execfile(string.lower(MODPREFIX) + 'typetest.py')
+exec(open(string.lower(MODPREFIX) + 'typetest.py').read())
# Our object types:
class FSCatalogInfoDefinition(PEP253Mixin, ObjectDefinition):
@@ -806,7 +806,7 @@
alias_methods = []
fsref_methods = []
fsspec_methods = []
-execfile(INPUTFILE)
+exec(open(INPUTFILE).read())
# Manual generators:
FSRefMakePath_body = """