Skip to content

Commit 2dc4064

Browse files
removed workaround for Python version 3.14.0 in @in_subprocess decorator
1 parent 5bee7fa commit 2dc4064

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## Pedantic 2.3.2
3+
- removed workaround for Python version `3.14.0` in `@in_subprocess` decorator
4+
- see https://github.com/python/cpython/issues/139894
5+
26
## Pedantic 2.3.1
37
- improve robustness of `WithDecoratedMethods`
48

pedantic/decorators/fn_deco_in_subprocess.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,11 @@ async def calculate_in_subprocess(func: Callable[..., Union[T, Awaitable[T]]], *
103103
return result
104104

105105

106-
def _inner(tx: Connection, fun: Callable[..., Union[T, Awaitable[T]]], *a, new_thread: bool = False, **kw_args) -> None:
106+
def _inner(tx: Connection, fun: Callable[..., Union[T, Awaitable[T]]], *a, **kw_args) -> None:
107107
""" This runs in another process. """
108108

109109
event_loop = None
110110
if inspect.iscoroutinefunction(fun):
111-
if not new_thread: # see https://stackoverflow.com/a/79785720/10975692
112-
import threading
113-
t = threading.Thread(target=_inner, args=(tx, fun, *a), kwargs=(kw_args | {"new_thread": True}))
114-
t.start()
115-
t.join()
116-
return
117-
118111
event_loop = asyncio.new_event_loop()
119112
asyncio.set_event_loop(event_loop)
120113

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "pedantic"
7-
version = "2.3.1"
7+
version = "2.3.2"
88
description = "Some useful Python decorators for cleaner software development."
99
readme = "README.md"
1010
requires-python = ">=3.11"

0 commit comments

Comments
 (0)