Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ab4c16

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 76078c0 commit 7ab4c16

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

mypyc/codegen/emitmodule.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -965,10 +965,10 @@ def generate_shared_lib_init(self, emitter: Emitter) -> None:
965965
)
966966
if self.context.group_deps:
967967
emitter.emit_line(
968-
'static PyObject *_mypyc_fromlist = NULL; '
969-
'if (!_mypyc_fromlist) { '
968+
"static PyObject *_mypyc_fromlist = NULL; "
969+
"if (!_mypyc_fromlist) { "
970970
'_mypyc_fromlist = Py_BuildValue("(s)", "*"); '
971-
'if (!_mypyc_fromlist) return -1; }'
971+
"if (!_mypyc_fromlist) return -1; }"
972972
)
973973
emitter.emit_line("PyObject *tmp;")
974974
emitter.emit_line("PyObject *caps;")
@@ -986,7 +986,7 @@ def generate_shared_lib_init(self, emitter: Emitter) -> None:
986986
'caps = PyObject_GetAttrString(tmp, "exports");',
987987
"Py_DECREF(tmp);",
988988
"if (!caps) return -1;",
989-
'struct export_table_{g} *pexports_{g} = '
989+
"struct export_table_{g} *pexports_{g} = "
990990
'(struct export_table_{g} *)PyCapsule_GetPointer(caps, "{lib}.exports");'.format(
991991
g=egroup, lib=shared_lib_name(group)
992992
),

mypyc/codegen/emitwrapper.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,7 @@ def generate_set_del_item_wrapper_inner(
705705
native_args = ", ".join(f"arg_{arg.name}" for arg in args)
706706
emitter.emit_line(
707707
"{}val = {}({});".format(
708-
emitter.ctype_spaced(fn.ret_type),
709-
emitter.native_function_call(fn.decl),
710-
native_args,
708+
emitter.ctype_spaced(fn.ret_type), emitter.native_function_call(fn.decl), native_args
711709
)
712710
)
713711
emitter.emit_error_check("val", fn.ret_type, "goto fail;")
@@ -945,9 +943,7 @@ def emit_call(self, not_implemented_handler: str = "") -> None:
945943
else:
946944
if not_implemented_handler and not isinstance(ret_type, RInstance):
947945
# The return value type may overlap with NotImplemented.
948-
emitter.emit_line(
949-
f"PyObject *retbox = {self.target_native_call}({native_args});"
950-
)
946+
emitter.emit_line(f"PyObject *retbox = {self.target_native_call}({native_args});")
951947
emitter.emit_lines(
952948
"if (retbox == Py_NotImplemented) {",
953949
not_implemented_handler,

mypyc/test-data/run-multimodule.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,4 +1641,3 @@ class Base:
16411641
from native import make_child
16421642
assert make_child(7) == "child(7)"
16431643
assert make_child(-1) == "child(-1)"
1644-

0 commit comments

Comments
 (0)