From 9a1592760ece131c3d0795477e7c85d62df5b960 Mon Sep 17 00:00:00 2001 From: Grant Baillie Date: Thu, 27 Aug 2009 18:57:13 -0700 Subject: [PATCH] Attempt to fix public enum values not being exported. --- Cython/Compiler/ParseTreeTransforms.py | 5 ++++- tests/run/public_enum.pyx | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/run/public_enum.pyx diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index 36200d74..ccc3129e 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -677,7 +677,10 @@ property NAME: return None def visit_CEnumDefNode(self, node): - return None + if node.visibility == 'public': + return node + else: + return None def visit_CStructOrUnionDefNode(self, node): return None diff --git a/tests/run/public_enum.pyx b/tests/run/public_enum.pyx new file mode 100644 index 00000000..f437aab3 --- /dev/null +++ b/tests/run/public_enum.pyx @@ -0,0 +1,7 @@ +__doc__ = u""" +>>> BAR +3 +""" + +cdef public enum FOO: + BAR = 3 -- 2.26.2