Skip to content

Commit 352d0d1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e584b9a commit 352d0d1

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

mypyc/codegen/emitmodule.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,9 @@ def emit_module_exec_func(
989989
# Patch async native functions so they're recognized as coroutines
990990
for fn in module.functions:
991991
if fn.decl.is_async and fn.class_name is None:
992-
emitter.emit_line(f'PyObject *func = PyObject_GetAttrString({module_static}, "{fn.decl.name}");')
992+
emitter.emit_line(
993+
f'PyObject *func = PyObject_GetAttrString({module_static}, "{fn.decl.name}");'
994+
)
993995
emitter.emit_line("if (!func) goto fail;")
994996
emitter.emit_line("if (!CPyPatchAsyncCode(func)) { Py_DECREF(func); goto fail; }")
995997
emitter.emit_line("Py_DECREF(func);")

mypyc/irbuild/prepare.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,7 @@ def prepare_func_def(
185185
else (FUNC_CLASSMETHOD if fdef.is_class else FUNC_NORMAL)
186186
)
187187
sig = mapper.fdef_to_sig(fdef, options.strict_dunders_typing)
188-
decl = FuncDecl(
189-
fdef.name,
190-
class_name,
191-
module_name,
192-
sig,
193-
kind=kind,
194-
is_async=fdef.is_coroutine,
195-
)
188+
decl = FuncDecl(fdef.name, class_name, module_name, sig, kind=kind, is_async=fdef.is_coroutine)
196189
mapper.func_to_decl[fdef] = decl
197190
return decl
198191

0 commit comments

Comments
 (0)