Skip to content

Commit

Permalink
Merge branch 'main' into inlinecomp2
Browse files Browse the repository at this point in the history
* main:
  pythongh-104276: Make `_struct.unpack_iterator` type use type flag instead of custom constructor (python#104277)
  pythongh-97696: Move around and update the whatsnew entry for asyncio eager task factory (python#104298)
  pythongh-103193: Fix refleaks in `test_inspect` and `test_typing` (python#104320)
  require-pr-label.yml: Add missing "permissions:" (python#104309)
  pythongh-90656: Add platform triplets for 64-bit LoongArch (LA64) (python#30939)
  pythongh-104180: Read SOCKS proxies from macOS System Configuration (python#104181)
  • Loading branch information
carljm committed May 9, 2023
2 parents 1402e7a + c21f828 commit 95401fe
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/require-pr-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]

permissions:
issues: read
pull-requests: read

jobs:
label:
name: DO-NOT-MERGE / unresolved review
Expand Down
18 changes: 13 additions & 5 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ asyncio
writing to sockets and uses :meth:`~socket.socket.sendmsg` if the platform
supports it. (Contributed by Kumar Aditya in :gh:`91166`.)

* Added :func:`asyncio.eager_task_factory` and :func:`asyncio.create_eager_task_factory`
functions to allow opting an event loop in to eager task execution,
making some use-cases 2x to 5x faster.
(Contributed by Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)

* On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default
if :func:`os.pidfd_open` is available and functional instead of
:class:`~asyncio.ThreadedChildWatcher`.
Expand Down Expand Up @@ -668,11 +673,6 @@ Optimizations
* Speed up :class:`asyncio.Task` creation by deferring expensive string formatting.
(Contributed by Itamar O in :gh:`103793`.)

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


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

* Add platform triplets for 64-bit LoongArch:

* loongarch64-linux-gnusf
* loongarch64-linux-gnuf32
* loongarch64-linux-gnu

(Contributed by Zhang Na in :gh:`90656`.)


C API Changes
=============
Expand Down
7 changes: 7 additions & 0 deletions Lib/test/libregrtest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ def clear_caches():
else:
fractions._hash_algorithm.cache_clear()

try:
inspect = sys.modules['inspect']
except KeyError:
pass
else:
inspect._shadowed_dict_from_mro_tuple.cache_clear()


def get_build_info():
# Get most important configure and build options as a list of strings.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Add platform triplets for 64-bit LoongArch:

* loongarch64-linux-gnusf
* loongarch64-linux-gnuf32
* loongarch64-linux-gnu

Patch by Zhang Na.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Support reading SOCKS proxy configuration from macOS System Configuration.
Patch by Sam Schott.
5 changes: 5 additions & 0 deletions Modules/_scproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ get_proxies(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
kSCPropNetProxiesGopherProxy,
kSCPropNetProxiesGopherPort);
if (r == -1) goto error;
r = set_proxy(result, "socks", proxyDict,
kSCPropNetProxiesSOCKSEnable,
kSCPropNetProxiesSOCKSProxy,
kSCPropNetProxiesSOCKSPort);
if (r == -1) goto error;

CFRelease(proxyDict);
return result;
Expand Down
8 changes: 1 addition & 7 deletions Modules/_struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -1832,19 +1832,13 @@ unpackiter_iternext(unpackiterobject *self)
return result;
}

PyObject *unpackiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
PyErr_Format(PyExc_TypeError, "Cannot create '%.200s objects", _PyType_Name(type));
return NULL;
}

static PyType_Slot unpackiter_type_slots[] = {
{Py_tp_dealloc, unpackiter_dealloc},
{Py_tp_getattro, PyObject_GenericGetAttr},
{Py_tp_traverse, unpackiter_traverse},
{Py_tp_iter, PyObject_SelfIter},
{Py_tp_iternext, unpackiter_iternext},
{Py_tp_methods, unpackiter_methods},
{Py_tp_new, unpackiter_new},
{0, 0},
};

Expand All @@ -1853,7 +1847,7 @@ static PyType_Spec unpackiter_type_spec = {
sizeof(unpackiterobject),
0,
(Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
Py_TPFLAGS_IMMUTABLETYPE),
Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
unpackiter_type_slots
};

Expand Down
14 changes: 14 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,20 @@ cat > conftest.c <<EOF
hppa-linux-gnu
# elif defined(__ia64__)
ia64-linux-gnu
# elif defined(__loongarch__)
# if defined(__loongarch_lp64)
# if defined(__loongarch_soft_float)
loongarch64-linux-gnusf
# elif defined(__loongarch_single_float)
loongarch64-linux-gnuf32
# elif defined(__loongarch_double_float)
loongarch64-linux-gnu
# else
# error unknown platform triplet
# endif
# else
# error unknown platform triplet
# endif
# elif defined(__m68k__) && !defined(__mcoldfire__)
m68k-linux-gnu
# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) && defined(_MIPSEL)
Expand Down

0 comments on commit 95401fe

Please sign in to comment.