From 35e28a5e9f81eb7f124313055c573c58a31f6790 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Tue, 20 Oct 2009 10:37:13 +0200 Subject: [PATCH] Blacklist __nonzero__ from autotestdict --- Cython/Compiler/AnalysedTreeTransforms.py | 2 +- tests/run/autotestdict.pyx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/AnalysedTreeTransforms.py b/Cython/Compiler/AnalysedTreeTransforms.py index 933250c6..300aebbc 100644 --- a/Cython/Compiler/AnalysedTreeTransforms.py +++ b/Cython/Compiler/AnalysedTreeTransforms.py @@ -10,7 +10,7 @@ import Naming class AutoTestDictTransform(ScopeTrackingTransform): # Handles autotestdict directive - blacklist = ['__cinit__', '__dealloc__', '__richcmp__'] + blacklist = ['__cinit__', '__dealloc__', '__richcmp__', '__nonzero__'] def visit_ModuleNode(self, node): self.scope_type = 'module' diff --git a/tests/run/autotestdict.pyx b/tests/run/autotestdict.pyx index bc1f7fc0..e4f47a44 100644 --- a/tests/run/autotestdict.pyx +++ b/tests/run/autotestdict.pyx @@ -102,5 +102,12 @@ cdef class MyCdefClass: False """ + def __nonzero__(self): + """ + Should not be included, as it can't be looked up with getattr in Py 3.1 + + >>> True + False + """ -- 2.26.2