Issue 2215: add a file() builtin to the compatability layer
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 23 Sep 2008 00:50:43 +0000 (00:50 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 23 Sep 2008 00:50:43 +0000 (00:50 +0000)
(for pre-2.2 Python versions).

git-svn-id: http://scons.tigris.org/svn/scons/trunk@3457 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/compat/builtins.py

index a4c3080c5c130255f68800e9e62e1038a80c8109..abac857638c4b9b1cca5b42fcfff7d6feb4c1c66 100644 (file)
@@ -135,6 +135,12 @@ except NameError:
     # Assign to True in this module namespace so it shows up in pydoc output.
     True = True
 
+try:
+    file
+except NameError:
+    # Pre-2.2 Python has no file() function.
+    __builtin__.file = open
+
 #
 try:
     zip