Skip to content

Commit 6c556ba

Browse files
authored
Merge pull request #315 from taskcluster/feat/python3.14-async
Python 3.14 raises RuntimeError if there are no running loops
2 parents 50b06ae + 1842472 commit 6c556ba

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

.taskcluster.yml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,37 @@ tasks:
3333
in:
3434
$let:
3535
tests:
36-
- image: 'python:3.13'
37-
name: python:3.13 tests
38-
command:
39-
- /bin/bash
40-
- '--login'
41-
- '-c'
42-
- >-
43-
git clone ${repo.git_url} repo &&
44-
cd repo &&
45-
git config advice.detachedHead false &&
46-
git checkout ${repo.ref} &&
47-
pip install -e . &&
48-
pip install pytest pytest-mock "pytest-asyncio>=0.18.0,<1.2" flake8 asyncmock &&
49-
pytest
50-
- image: 'python:3.13'
51-
name: flake
52-
command:
53-
- /bin/bash
54-
- '--login'
55-
- '-c'
56-
- >-
57-
git clone ${repo.git_url} repo &&
58-
cd repo &&
59-
git config advice.detachedHead false &&
60-
git checkout ${repo.ref} &&
61-
pip install -e . &&
62-
pip install flake8 &&
63-
flake8 tcadmin
36+
$flatten:
37+
$map: ['3.13', '3.14']
38+
each(version):
39+
- image: 'python:${version}'
40+
name: 'python:${version} tests'
41+
command:
42+
- /bin/bash
43+
- '--login'
44+
- '-c'
45+
- >-
46+
git clone ${repo.git_url} repo &&
47+
cd repo &&
48+
git config advice.detachedHead false &&
49+
git checkout ${repo.ref} &&
50+
pip install -e . &&
51+
pip install pytest pytest-mock "pytest-asyncio>=0.18.0,<1.2" flake8 asyncmock &&
52+
pytest
53+
- image: 'python:${version}'
54+
name: flake
55+
command:
56+
- /bin/bash
57+
- '--login'
58+
- '-c'
59+
- >-
60+
git clone ${repo.git_url} repo &&
61+
cd repo &&
62+
git config advice.detachedHead false &&
63+
git checkout ${repo.ref} &&
64+
pip install -e . &&
65+
pip install flake8 &&
66+
flake8 tcadmin
6467
in:
6568
$let:
6669
test_tasks:

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
'Programming Language :: Python :: 3.11',
3030
'Programming Language :: Python :: 3.12',
3131
'Programming Language :: Python :: 3.13',
32+
'Programming Language :: Python :: 3.14',
3233
],
3334
entry_points={
3435
"console_scripts": [

tcadmin/main.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ def run_pre_check(name):
4242
def run_async(fn):
4343
@functools.wraps(fn)
4444
def wrap(*args, **kwargs):
45-
try:
46-
loop = asyncio.get_event_loop()
47-
return loop.run_until_complete(fn(*args, **kwargs))
48-
finally:
49-
loop.close()
45+
return asyncio.run(fn(*args, **kwargs))
5046

5147
return wrap
5248

0 commit comments

Comments
 (0)