Skip to content

Commit 259d89a

Browse files
fix: serialization segfault
1 parent 292e849 commit 259d89a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mypyc/ir/class_ir.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def __init__(
9494
is_abstract: bool = False,
9595
is_ext_class: bool = True,
9696
is_final_class: bool = False,
97-
supports_weakref: bool = False,
9897
) -> None:
9998
self.name = name
10099
self.module_name = module_name
@@ -103,14 +102,15 @@ def __init__(
103102
self.is_abstract = is_abstract
104103
self.is_ext_class = is_ext_class
105104
self.is_final_class = is_final_class
106-
self.supports_weakref = supports_weakref
107105
# An augmented class has additional methods separate from what mypyc generates.
108106
# Right now the only one is dataclasses.
109107
self.is_augmented = False
110108
# Does this inherit from a Python class?
111109
self.inherits_python = False
112110
# Do instances of this class have __dict__?
113111
self.has_dict = False
112+
# Do instances of this class have __weakref__?
113+
self.supports_weakref = False
114114
# Do we allow interpreted subclasses? Derived from a mypyc_attr.
115115
self.allow_interpreted_subclasses = False
116116
# Does this class need getseters to be generated for its attributes? (getseters are also
@@ -362,9 +362,9 @@ def serialize(self) -> JsonDict:
362362
"is_generated": self.is_generated,
363363
"is_augmented": self.is_augmented,
364364
"is_final_class": self.is_final_class,
365-
"supports_weakref": self.supports_weakref,
366365
"inherits_python": self.inherits_python,
367366
"has_dict": self.has_dict,
367+
"supports_weakref": self.supports_weakref,
368368
"allow_interpreted_subclasses": self.allow_interpreted_subclasses,
369369
"needs_getseters": self.needs_getseters,
370370
"_serializable": self._serializable,

0 commit comments

Comments
 (0)