Skip to content

Commit 95401fe

Browse files
committed
Merge branch 'main' into inlinecomp2
* main: gh-104276: Make `_struct.unpack_iterator` type use type flag instead of custom constructor (#104277) gh-97696: Move around and update the whatsnew entry for asyncio eager task factory (#104298) gh-103193: Fix refleaks in `test_inspect` and `test_typing` (#104320) require-pr-label.yml: Add missing "permissions:" (#104309) gh-90656: Add platform triplets for 64-bit LoongArch (LA64) (#30939) gh-104180: Read SOCKS proxies from macOS System Configuration (#104181)
2 parents 1402e7a + c21f828 commit 95401fe

File tree

9 files changed

+67
-12
lines changed

9 files changed

+67
-12
lines changed

.github/workflows/require-pr-label.yml

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
types: [opened, reopened, labeled, unlabeled, synchronize]
66

7+
permissions:
8+
issues: read
9+
pull-requests: read
10+
711
jobs:
812
label:
913
name: DO-NOT-MERGE / unresolved review

Doc/whatsnew/3.12.rst

+13-5
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ asyncio
306306
writing to sockets and uses :meth:`~socket.socket.sendmsg` if the platform
307307
supports it. (Contributed by Kumar Aditya in :gh:`91166`.)
308308

309+
* Added :func:`asyncio.eager_task_factory` and :func:`asyncio.create_eager_task_factory`
310+
functions to allow opting an event loop in to eager task execution,
311+
making some use-cases 2x to 5x faster.
312+
(Contributed by Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)
313+
309314
* On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default
310315
if :func:`os.pidfd_open` is available and functional instead of
311316
:class:`~asyncio.ThreadedChildWatcher`.
@@ -668,11 +673,6 @@ Optimizations
668673
* Speed up :class:`asyncio.Task` creation by deferring expensive string formatting.
669674
(Contributed by Itamar O in :gh:`103793`.)
670675

671-
* Added :func:`asyncio.eager_task_factory` and :func:`asyncio.create_eager_task_factory`
672-
functions to allow opting an event loop in to eager task execution,
673-
speeding up some use-cases by up to 50%.
674-
(Contributed by Jacob Bower & Itamar O in :gh:`102853`)
675-
676676

677677
CPython bytecode changes
678678
========================
@@ -1193,6 +1193,14 @@ Build Changes
11931193
optimization levels (0, 1, 2) at once.
11941194
(Contributed by Victor Stinner in :gh:`99289`.)
11951195

1196+
* Add platform triplets for 64-bit LoongArch:
1197+
1198+
* loongarch64-linux-gnusf
1199+
* loongarch64-linux-gnuf32
1200+
* loongarch64-linux-gnu
1201+
1202+
(Contributed by Zhang Na in :gh:`90656`.)
1203+
11961204

11971205
C API Changes
11981206
=============

Lib/test/libregrtest/utils.py

+7
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,13 @@ def clear_caches():
210210
else:
211211
fractions._hash_algorithm.cache_clear()
212212

213+
try:
214+
inspect = sys.modules['inspect']
215+
except KeyError:
216+
pass
217+
else:
218+
inspect._shadowed_dict_from_mro_tuple.cache_clear()
219+
213220

214221
def get_build_info():
215222
# Get most important configure and build options as a list of strings.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Add platform triplets for 64-bit LoongArch:
2+
3+
* loongarch64-linux-gnusf
4+
* loongarch64-linux-gnuf32
5+
* loongarch64-linux-gnu
6+
7+
Patch by Zhang Na.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Support reading SOCKS proxy configuration from macOS System Configuration.
2+
Patch by Sam Schott.

Modules/_scproxy.c

+5
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ get_proxies(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
206206
kSCPropNetProxiesGopherProxy,
207207
kSCPropNetProxiesGopherPort);
208208
if (r == -1) goto error;
209+
r = set_proxy(result, "socks", proxyDict,
210+
kSCPropNetProxiesSOCKSEnable,
211+
kSCPropNetProxiesSOCKSProxy,
212+
kSCPropNetProxiesSOCKSPort);
213+
if (r == -1) goto error;
209214

210215
CFRelease(proxyDict);
211216
return result;

Modules/_struct.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -1832,19 +1832,13 @@ unpackiter_iternext(unpackiterobject *self)
18321832
return result;
18331833
}
18341834

1835-
PyObject *unpackiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
1836-
PyErr_Format(PyExc_TypeError, "Cannot create '%.200s objects", _PyType_Name(type));
1837-
return NULL;
1838-
}
1839-
18401835
static PyType_Slot unpackiter_type_slots[] = {
18411836
{Py_tp_dealloc, unpackiter_dealloc},
18421837
{Py_tp_getattro, PyObject_GenericGetAttr},
18431838
{Py_tp_traverse, unpackiter_traverse},
18441839
{Py_tp_iter, PyObject_SelfIter},
18451840
{Py_tp_iternext, unpackiter_iternext},
18461841
{Py_tp_methods, unpackiter_methods},
1847-
{Py_tp_new, unpackiter_new},
18481842
{0, 0},
18491843
};
18501844

@@ -1853,7 +1847,7 @@ static PyType_Spec unpackiter_type_spec = {
18531847
sizeof(unpackiterobject),
18541848
0,
18551849
(Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
1856-
Py_TPFLAGS_IMMUTABLETYPE),
1850+
Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
18571851
unpackiter_type_slots
18581852
};
18591853

configure

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+14
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,20 @@ cat > conftest.c <<EOF
959959
hppa-linux-gnu
960960
# elif defined(__ia64__)
961961
ia64-linux-gnu
962+
# elif defined(__loongarch__)
963+
# if defined(__loongarch_lp64)
964+
# if defined(__loongarch_soft_float)
965+
loongarch64-linux-gnusf
966+
# elif defined(__loongarch_single_float)
967+
loongarch64-linux-gnuf32
968+
# elif defined(__loongarch_double_float)
969+
loongarch64-linux-gnu
970+
# else
971+
# error unknown platform triplet
972+
# endif
973+
# else
974+
# error unknown platform triplet
975+
# endif
962976
# elif defined(__m68k__) && !defined(__mcoldfire__)
963977
m68k-linux-gnu
964978
# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) && defined(_MIPSEL)

0 commit comments

Comments
 (0)