From 22111321b037fc20ebe9af6723b24080278535a9 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 2 Nov 2010 16:58:59 +0100 Subject: [PATCH] prevent 'file' from being recognised as a builtin type - it's no longer available in Py3 --- Cython/Compiler/Builtin.py | 5 +++-- Cython/Compiler/Symtab.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cython/Compiler/Builtin.py b/Cython/Compiler/Builtin.py index 24b4f971..b88dba9b 100644 --- a/Cython/Compiler/Builtin.py +++ b/Cython/Compiler/Builtin.py @@ -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 ) diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index a160842f..b229ee27 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -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], -- 2.26.2