Skip to content

Commit 1d1a387

Browse files
authored
Merge branch 'main' into gh-125588
2 parents fe92c2c + d83fcf8 commit 1d1a387

File tree

8 files changed

+22
-8
lines changed

8 files changed

+22
-8
lines changed

.github/workflows/mypy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- uses: actions/checkout@v4
5454
- uses: actions/setup-python@v5
5555
with:
56-
python-version: "3.11"
56+
python-version: "3.13"
5757
cache: pip
5858
cache-dependency-path: Tools/requirements-dev.txt
5959
- run: pip install -r Tools/requirements-dev.txt

Include/internal/mimalloc/mimalloc/prim.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept {
151151
// If you test on another platform and it works please send a PR :-)
152152
// see also https://akkadia.org/drepper/tls.pdf for more info on the TLS register.
153153
#elif defined(__GNUC__) && ( \
154-
(defined(__GLIBC__) && (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__))) \
154+
(defined(__GLIBC__) && (defined(__x86_64__) || defined(__i386__) || (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__))) \
155155
|| (defined(__APPLE__) && (defined(__x86_64__) || defined(__aarch64__))) \
156-
|| (defined(__BIONIC__) && (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__))) \
156+
|| (defined(__BIONIC__) && (defined(__x86_64__) || defined(__i386__) || (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__))) \
157157
|| (defined(__FreeBSD__) && (defined(__x86_64__) || defined(__i386__) || defined(__aarch64__))) \
158158
|| (defined(__OpenBSD__) && (defined(__x86_64__) || defined(__i386__) || defined(__aarch64__))) \
159159
)

Include/object.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ _Py_ThreadId(void)
192192
__asm__("movq %%gs:0, %0" : "=r" (tid)); // x86_64 macOSX uses GS
193193
#elif defined(__x86_64__)
194194
__asm__("movq %%fs:0, %0" : "=r" (tid)); // x86_64 Linux, BSD uses FS
195-
#elif defined(__arm__)
195+
#elif defined(__arm__) && __ARM_ARCH >= 7
196196
__asm__ ("mrc p15, 0, %0, c13, c0, 3\nbic %0, %0, #3" : "=r" (tid));
197197
#elif defined(__aarch64__) && defined(__APPLE__)
198198
__asm__ ("mrs %0, tpidrro_el0" : "=r" (tid));

Lib/test/test_urllib2.py

+1
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ def connect_ftp(self, user, passwd, host, port, dirs,
794794
self.assertEqual(headers.get("Content-type"), mimetype)
795795
self.assertEqual(int(headers["Content-length"]), len(data))
796796

797+
@support.requires_resource("network")
797798
def test_ftp_error(self):
798799
class ErrorFTPHandler(urllib.request.FTPHandler):
799800
def __init__(self, exception):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix illegal instruction for older Arm architectures. Patch by Diego Russo, testing by Ross Burton.

Python/ceval.c

+14
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,16 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)
761761
* so consume 3 units of C stack */
762762
#define PY_EVAL_C_STACK_UNITS 2
763763

764+
#if defined(_MSC_VER) && defined(_Py_USING_PGO) && defined(_Py_JIT)
765+
/* _PyEval_EvalFrameDefault is too large to optimize for speed with
766+
PGO on MSVC when the JIT is enabled. Disable that optimization
767+
around this function only. If this is fixed upstream, we should
768+
gate this on the version of MSVC.
769+
*/
770+
# pragma optimize("t", off)
771+
/* This setting is reversed below following _PyEval_EvalFrameDefault */
772+
#endif
773+
764774
PyObject* _Py_HOT_FUNCTION
765775
_PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int throwflag)
766776
{
@@ -1136,6 +1146,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
11361146

11371147
}
11381148

1149+
#if defined(_MSC_VER) && defined(_Py_USING_PGO) && defined(_Py_JIT)
1150+
# pragma optimize("", on)
1151+
#endif
1152+
11391153
#if defined(__GNUC__)
11401154
# pragma GCC diagnostic pop
11411155
#elif defined(_MSC_VER) /* MS_WINDOWS */

Tools/clinic/libclinic/converter.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,7 @@ def closure(f: CConverterClassT) -> CConverterClassT:
545545
if not kwargs:
546546
added_f = f
547547
else:
548-
# type ignore due to a mypy regression :(
549-
# https://github.com/python/mypy/issues/17646
550-
added_f = functools.partial(f, **kwargs) # type: ignore[misc]
548+
added_f = functools.partial(f, **kwargs)
551549
if format_unit:
552550
legacy_converters[format_unit] = added_f
553551
return f

Tools/requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Requirements file for external linters and checks we run on
22
# Tools/clinic, Tools/cases_generator/, and Tools/peg_generator/ in CI
3-
mypy==1.11.2
3+
mypy==1.12
44

55
# needed for peg_generator:
66
types-psutil==6.0.0.20240901

0 commit comments

Comments
 (0)