prevent 'file' from being recognised as a builtin type - it's no longer available...
authorStefan Behnel <scoder@users.berlios.de>
Tue, 2 Nov 2010 15:58:59 +0000 (16:58 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 2 Nov 2010 15:58:59 +0000 (16:58 +0100)
Cython/Compiler/Builtin.py
Cython/Compiler/Symtab.py

index 24b4f971d4eeedbf6f4c4cef4498874bd1e93a3a..b88dba9b914d5d2e6eb58910bbbf5a6f261c0d5e 100644 (file)
@@ -115,7 +115,7 @@ builtin_types_table = [
                                     ("copy",  "O",   "O", "PyDict_Copy")]),
 
     ("slice",   "PySlice_Type",    []),
-    ("file",    "PyFile_Type",     []),
+#    ("file",    "PyFile_Type",     []),  # not in Py3
 
     ("set",       "PySet_Type",    [("clear",   "O",  "i", "PySet_Clear"), 
                                     ("discard", "OO", "i", "PySet_Discard"),
@@ -128,8 +128,9 @@ types_that_construct_their_instance = (
     # some builtin types do not always return an instance of
     # themselves - these do:
     'type', 'bool', 'long', 'float', 'bytes', 'unicode', 'tuple', 'list',
-    'dict', 'file', 'set', 'frozenset'
+    'dict', 'set', 'frozenset'
     # 'str',             # only in Py3.x
+    # 'file',            # only in Py2.x
     )
 
         
index a160842fd22f22f318df217a8bb27bca8399a7f8..b229ee27ad19b4fdddb81e547a6919a155eb671c 100644 (file)
@@ -772,7 +772,7 @@ class BuiltinScope(Scope):
         "frozenset":   ["((PyObject*)&PyFrozenSet_Type)", py_object_type],
 
         "slice":  ["((PyObject*)&PySlice_Type)", py_object_type],
-        "file":   ["((PyObject*)&PyFile_Type)", py_object_type],
+#        "file":   ["((PyObject*)&PyFile_Type)", py_object_type],  # not in Py3
 
         "None":   ["Py_None", py_object_type],
         "False":  ["Py_False", py_object_type],