Skip to content

Commit d0be9c7

Browse files
committed
fix: serialization segfault
1 parent 6420cce commit d0be9c7

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
@@ -368,9 +368,9 @@ def serialize(self) -> JsonDict:
368368
"is_generated": self.is_generated,
369369
"is_augmented": self.is_augmented,
370370
"is_final_class": self.is_final_class,
371-
"supports_weakref": self.supports_weakref,
372371
"inherits_python": self.inherits_python,
373372
"has_dict": self.has_dict,
373+
"supports_weakref": self.supports_weakref,
374374
"allow_interpreted_subclasses": self.allow_interpreted_subclasses,
375375
"needs_getseters": self.needs_getseters,
376376
"_serializable": self._serializable,

0 commit comments

Comments
 (0)