Skip to content

Commit f473b54

Browse files
committed
fix python 3.14 warnings
1 parent 3a96533 commit f473b54

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
job-name: "python-{0} {1}"
2828
run-cmd: "hatch test"
2929
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
30-
python-version: '["3.10", "3.11", "3.12", "3.13"]'
30+
python-version: '["3.11", "3.12", "3.13", "3.14"]'
3131
test-documentation:
3232
# Temporarily disabled while we transition from Sphinx to MkDocs
3333
# https://github.com/reactive-python/reactpy/pull/1052

src/reactpy/core/events.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3-
import asyncio
43
import dis
4+
import inspect
55
from collections.abc import Callable, Sequence
66
from typing import Any, Literal, cast, overload
77

@@ -160,7 +160,7 @@ def to_event_handler_function(
160160
Whether to pass the event parameters a positional args or as a list.
161161
"""
162162
if positional_args:
163-
if asyncio.iscoroutinefunction(function):
163+
if inspect.iscoroutinefunction(function):
164164

165165
async def wrapper(data: Sequence[Any]) -> None:
166166
await function(*data)
@@ -174,7 +174,7 @@ async def wrapper(data: Sequence[Any]) -> None:
174174

175175
cast(Any, wrapper).__wrapped__ = function
176176
return wrapper
177-
elif not asyncio.iscoroutinefunction(function):
177+
elif not inspect.iscoroutinefunction(function):
178178

179179
async def wrapper(data: Sequence[Any]) -> None:
180180
function(data)

src/reactpy/core/hooks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import contextlib
5+
import inspect
56
from collections.abc import Callable, Coroutine, Sequence
67
from logging import getLogger
78
from types import FunctionType
@@ -144,7 +145,7 @@ def use_effect(
144145
Returns:
145146
If not function is provided, a decorator. Otherwise ``None``.
146147
"""
147-
if asyncio.iscoroutinefunction(function):
148+
if inspect.iscoroutinefunction(function):
148149
raise TypeError(
149150
"`use_effect` does not support async functions. "
150151
"Use `use_async_effect` instead."

0 commit comments

Comments
 (0)