From 274a52f89e827d3d1b819500c246436d8166109d Mon Sep 17 00:00:00 2001
From: Xavier Thompson <xavier.thompson@nexedi.com>
Date: Mon, 25 May 2020 11:00:39 +0200
Subject: [PATCH] Fix code generation of cypclass attributes in cclass

---
 Cython/Compiler/ModuleNode.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index ab82a5baa..ff0a31097 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -2001,8 +2001,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
         if scope.is_internal:
             # internal classes (should) never need None inits, normal zeroing will do
             py_attrs = []
+
+        # cyp_class attributes should not be treated as normal cpp_class attributes
         cpp_class_attrs = [entry for entry in scope.var_entries
-                           if entry.type.is_cpp_class]
+                           if entry.type.is_cpp_class and not entry.type.is_cyp_class]
 
         cinit_func_entry = scope.lookup_here("__cinit__")
         if cinit_func_entry and not cinit_func_entry.is_special:
-- 
2.30.9