Skip to content

Commit 1a14d97

Browse files
Update specialize.py
1 parent 9ead556 commit 1a14d97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mypyc/irbuild/specialize.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,11 @@ def apply_function_specialization(
144144
"""Invoke the Specializer callback for a function if one has been registered"""
145145
if (
146146
isinstance(callee, NameExpr)
147-
and isinstance(callee.node, Var)
147+
# and isinstance(callee.node, Var)
148148
# NOTE: why is this not a weakref rprimitive?
149149
# TODO: fix to weakref rprimitive so _apply_specialization can use the custom_op
150-
and str(callee.node.type).startswith("weakref.ReferenceType")
150+
and is_weakref_rprimitive(builder.node_type(callee.node))
151+
# and str(callee.node.type).startswith("weakref.ReferenceType")
151152
and len(expr.args) == 0
152153
):
153154
return builder.call_c(weakref_deref_op, [builder.accept(expr.callee)], expr.line)

0 commit comments

Comments
 (0)