Skip to content

Commit ff8d287

Browse files
committed
Move comment to correct place
The comment about why we have to decref and clear type structs got moved in one of the previous commits, so move it back to the right place.
1 parent 9420cec commit ff8d287

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypyc/codegen/emitmodule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,14 +923,14 @@ def generate_module_def(self, emitter: Emitter, module_name: str, module: Module
923923
emitter.emit_lines('fail:',
924924
'Py_CLEAR({});'.format(module_static),
925925
'Py_CLEAR(modname);')
926-
# the type objects returned from CPyType_FromTemplate are all new references
927-
# so we have to decref them
928926
for name, typ in module.final_names:
929927
static_name = emitter.static_name(name, module_name)
930928
if emitter.ctype(typ) == 'PyObject *':
931929
emitter.emit_line('Py_CLEAR({});'.format(static_name))
932930
elif is_tagged(typ):
933931
emitter.emit_line('CPyTagged_XDecRef({});'.format(static_name))
932+
# the type objects returned from CPyType_FromTemplate are all new references
933+
# so we have to decref them
934934
for t in type_structs:
935935
emitter.emit_line('Py_CLEAR({});'.format(t))
936936
emitter.emit_line('return NULL;')

0 commit comments

Comments
 (0)