Skip to content

Commit aeb4990

Browse files
committed
Fix enum members not being exported in Cython 3.1
1 parent bc96211 commit aeb4990

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

fastwarc-py/fastwarc/warc.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ __all__ = [
6868
'any_type',
6969
]
7070

71+
# Cython 3.1 doesn't export enum members anymore
72+
globals().update(getattr(WarcRecordType, '__members__'))
73+
7174

7275
cdef const char* _enum_record_type_to_str(WarcRecordType record_type) noexcept nogil:
7376
if record_type == warcinfo:

resiliparse-py/resiliparse/parse/html.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ __all__ = [
4545
'DOCUMENT_TYPE',
4646
'DOCUMENT_FRAGMENT',
4747
'NOTATION',
48-
'LAST_ENTRY',
4948
]
5049

50+
# Cython 3.1 doesn't export enum members anymore
51+
globals().update(getattr(NodeType, '__members__'))
52+
5153

5254
cdef inline DOMNode _create_dom_node(HTMLTree tree, lxb_dom_node_t* dom_node):
5355
if not dom_node:

0 commit comments

Comments
 (0)