Skip to content

Commit

Permalink
coerced types in debug mode (compatibility with Python 3.12)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaspuff committed Dec 14, 2023
1 parent 325a675 commit f797114
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tomodachi/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,14 @@ def invoker_function_sorter(m: str) -> int:
for task in tasks:
try:
co_filename = (

Check warning on line 558 in tomodachi/container.py

View check run for this annotation

Codecov / codecov/patch

tomodachi/container.py#L558

Added line #L558 was not covered by tests
task.get_coro().cr_code.co_filename # type: ignore[union-attr]
cast(Any, task.get_coro()).cr_code.co_filename
if hasattr(task, "get_coro")
else task._coro.cr_code.co_filename # type: ignore[attr-defined]
else cast(Any, task)._coro.cr_code.co_filename
)
co_name = (

Check warning on line 563 in tomodachi/container.py

View check run for this annotation

Codecov / codecov/patch

tomodachi/container.py#L563

Added line #L563 was not covered by tests
task.get_coro().cr_code.co_name if hasattr(task, "get_coro") else task._coro.cr_code.co_name # type: ignore[union-attr, attr-defined]
cast(Any, task.get_coro()).cr_code.co_name
if hasattr(task, "get_coro")
else cast(Any, task).cr_code.co_name
)

if "/tomodachi/watcher.py" in co_filename and co_name == "_watch_loop":
Expand Down

0 comments on commit f797114

Please sign in to comment.