Skip to content

Commit 980b4c5

Browse files
authored
[ruff-ecosystem] Fix CLI crash on Python 3.14 (#21092)
1 parent 5139f76 commit 980b4c5

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,7 @@ jobs:
531531
persist-credentials: false
532532
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
533533
with:
534-
# TODO: figure out why `ruff-ecosystem` crashes on Python 3.14
535-
python-version: "3.13"
534+
python-version: ${{ env.PYTHON_VERSION }}
536535
activate-environment: true
537536

538537
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0

python/ruff-ecosystem/ruff_ecosystem/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ def entrypoint():
8787
)
8888

8989
with cache_context as cache:
90-
loop = asyncio.get_event_loop()
90+
loop = asyncio.new_event_loop()
91+
asyncio.set_event_loop(loop)
9192
main_task = asyncio.ensure_future(
9293
main(
9394
command=RuffCommand(args.ruff_command),

scripts/check_ecosystem.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ async def limited_parallelism(coroutine: T) -> T:
528528
else:
529529
logging.basicConfig(level=logging.INFO)
530530

531-
loop = asyncio.get_event_loop()
531+
loop = asyncio.new_event_loop()
532+
asyncio.set_event_loop(loop)
532533
if args.checkouts:
533534
args.checkouts.mkdir(exist_ok=True, parents=True)
534535
main_task = asyncio.ensure_future(

0 commit comments

Comments
 (0)