Skip to content

Commit a0ad829

Browse files
committed
bpo-41100: additional fixes for testing on macOS 11 Big Sur Intel
Note: macOS 11 is not yet released, this release of Python is not fully supported on 11.0, and not all tests pass.
1 parent cf79cbf commit a0ad829

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

Lib/distutils/tests/test_build_ext.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def _try_compile_deployment_target(self, operator, target):
470470
# format the target value as defined in the Apple
471471
# Availability Macros. We can't use the macro names since
472472
# at least one value we test with will not exist yet.
473-
if target[1] < 10:
473+
if target[:2] < (10, 10):
474474
# for 10.1 through 10.9.x -> "10n0"
475475
target = '%02d%01d0' % target
476476
else:

Lib/test/test_platform.py

+5
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ def test_mac_ver(self):
236236
fd.close()
237237
self.assertFalse(real_ver is None)
238238
result_list = res[0].split('.')
239+
# macOS 11.0 (Big Sur) may report its version number
240+
# as 10.16 if the executable is built with an older
241+
# SDK target but sw_vers reports 11.0.
242+
if result_list == ['10', '16']:
243+
result_list = ['11', '0']
239244
expect_list = real_ver.split('.')
240245
len_diff = len(result_list) - len(expect_list)
241246
# On Snow Leopard, sw_vers reports 10.6.0 as 10.6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Additional fixes for testing on macOS 11 Big Sur Intel. Note: macOS 11 is
2+
not yet released, this release of Python is not fully supported on 11.0, and
3+
not all tests pass.

Modules/getpath.c

-4
Original file line numberDiff line numberDiff line change
@@ -566,11 +566,7 @@ calculate_program_full_path(const _PyCoreConfig *core_config,
566566
memset(program_full_path, 0, sizeof(program_full_path));
567567

568568
#ifdef __APPLE__
569-
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
570569
uint32_t nsexeclength = MAXPATHLEN;
571-
#else
572-
unsigned long nsexeclength = MAXPATHLEN;
573-
#endif
574570
char execpath[MAXPATHLEN+1];
575571
#endif
576572

configure

+3
Original file line numberDiff line numberDiff line change
@@ -9251,6 +9251,9 @@ fi
92519251
ppc)
92529252
MACOSX_DEFAULT_ARCH="ppc64"
92539253
;;
9254+
arm64)
9255+
MACOSX_DEFAULT_ARCH="arm64"
9256+
;;
92549257
*)
92559258
as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5
92569259
;;

configure.ac

+3
Original file line numberDiff line numberDiff line change
@@ -2456,6 +2456,9 @@ case $ac_sys_system/$ac_sys_release in
24562456
ppc)
24572457
MACOSX_DEFAULT_ARCH="ppc64"
24582458
;;
2459+
arm64)
2460+
MACOSX_DEFAULT_ARCH="arm64"
2461+
;;
24592462
*)
24602463
AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
24612464
;;

0 commit comments

Comments
 (0)