From: Robert Bradshaw Date: Wed, 25 Mar 2009 22:54:27 +0000 (-0700) Subject: Warning, not error, on builting type redeclaration. X-Git-Tag: 0.11.1.alpha~38 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e1881e057eb51c9bbbc5c69c9af900ab3493b75e;p=cython.git Warning, not error, on builting type redeclaration. Throwing an error is to invasive for 0.11.x, and also one needs to be able to subclass/access attributes of builtin types before we get rid of the declaration altogether. --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 60dbc28c..68f12906 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2679,8 +2679,7 @@ class CClassDefNode(ClassDefNode): if self.visibility == 'extern': if self.module_name == '__builtin__' and self.class_name in Builtin.builtin_types: - error(self.pos, "%s already a builtin Cython type" % self.class_name) - return + warning(self.pos, "%s already a builtin Cython type" % self.class_name, 1) self.entry = home_scope.declare_c_class( name = self.class_name, diff --git a/tests/errors/builtin_type_conflict_T170.pyx b/tests/errors/builtin_type_conflict_T170.pyx index c1c8ac90..89d41536 100644 --- a/tests/errors/builtin_type_conflict_T170.pyx +++ b/tests/errors/builtin_type_conflict_T170.pyx @@ -3,6 +3,13 @@ cdef extern from *: pass cdef list foo = [] -_ERRORS = u""" + +# This is too invasive for Python 0.11.x, re-enable in 0.12 +NEW_ERRORS = u""" :2:4: list already a builtin Cython type """ + +_ERRORS = u""" +:5:16: Cannot coerce list to type 'list' +""" +