[Python-checkins] bpo-41100: additional fixes for testing on macOS 11 Big Sur Intel

Ned Deily webhook-mailer at python.org
Mon Aug 17 18:25:44 EDT 2020


https://github.com/python/cpython/commit/a0ad82959652ff64c99231f457fd740b17330514
commit: a0ad82959652ff64c99231f457fd740b17330514
branch: 3.7
author: Ned Deily <nad at python.org>
committer: Ned Deily <nad at python.org>
date: 2020-08-15T01:08:56-04:00
summary:

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.

files:
A Misc/NEWS.d/next/macOS/2020-08-15-00-33-27.bpo-41100.AksBg1.rst
M Lib/distutils/tests/test_build_ext.py
M Lib/test/test_platform.py
M Modules/getpath.c
M configure
M configure.ac

diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index 88847f9e9aa7b..d0428599a40af 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -470,7 +470,7 @@ def _try_compile_deployment_target(self, operator, target):
         # format the target value as defined in the Apple
         # Availability Macros.  We can't use the macro names since
         # at least one value we test with will not exist yet.
-        if target[1] < 10:
+        if target[:2] < (10, 10):
             # for 10.1 through 10.9.x -> "10n0"
             target = '%02d%01d0' % target
         else:
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index d91e978a79f3f..452a56e8b4e2b 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -236,6 +236,11 @@ def test_mac_ver(self):
             fd.close()
             self.assertFalse(real_ver is None)
             result_list = res[0].split('.')
+            # macOS 11.0 (Big Sur) may report its version number
+            # as 10.16 if the executable is built with an older
+            # SDK target but sw_vers reports 11.0.
+            if result_list == ['10', '16']:
+                result_list = ['11', '0']
             expect_list = real_ver.split('.')
             len_diff = len(result_list) - len(expect_list)
             # On Snow Leopard, sw_vers reports 10.6.0 as 10.6
diff --git a/Misc/NEWS.d/next/macOS/2020-08-15-00-33-27.bpo-41100.AksBg1.rst b/Misc/NEWS.d/next/macOS/2020-08-15-00-33-27.bpo-41100.AksBg1.rst
new file mode 100644
index 0000000000000..b6e12dc340440
--- /dev/null
+++ b/Misc/NEWS.d/next/macOS/2020-08-15-00-33-27.bpo-41100.AksBg1.rst
@@ -0,0 +1,3 @@
+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.
diff --git a/Modules/getpath.c b/Modules/getpath.c
index ba8d74b4a0427..35f9e31d1ed4d 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -566,11 +566,7 @@ calculate_program_full_path(const _PyCoreConfig *core_config,
     memset(program_full_path, 0, sizeof(program_full_path));
 
 #ifdef __APPLE__
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
     uint32_t nsexeclength = MAXPATHLEN;
-#else
-    unsigned long nsexeclength = MAXPATHLEN;
-#endif
     char execpath[MAXPATHLEN+1];
 #endif
 
diff --git a/configure b/configure
index c807c98e568f8..829dd69bb8b30 100755
--- a/configure
+++ b/configure
@@ -9251,6 +9251,9 @@ fi
     	ppc)
     		MACOSX_DEFAULT_ARCH="ppc64"
     		;;
+    	arm64)
+    		MACOSX_DEFAULT_ARCH="arm64"
+    		;;
     	*)
     		as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5
     		;;
diff --git a/configure.ac b/configure.ac
index 805c0bba08deb..f1cc8e9bcb9ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2456,6 +2456,9 @@ case $ac_sys_system/$ac_sys_release in
     	ppc)
     		MACOSX_DEFAULT_ARCH="ppc64"
     		;;
+    	arm64)
+    		MACOSX_DEFAULT_ARCH="arm64"
+    		;;
     	*)
     		AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
     		;;



More information about the Python-checkins mailing list