@@ -113,7 +113,7 @@ index 1f6baed66d3..235dd98c60a 100644
113113 macos_release = mac_ver()[0]
114114 if macos_release:
115115diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py
116- index 69f72452c40..34ce643340b 100644
116+ index 18e6b8d25e5..4994c56778c 100644
117117--- a/Lib/sysconfig/__init__.py
118118+++ b/Lib/sysconfig/__init__.py
119119@@ -719,6 +719,14 @@
@@ -163,7 +163,7 @@ index ec0857a4a99..2350e9dc821 100644
163163 # elif !defined(TARGET_OS_OSX) || TARGET_OS_OSX
164164 PLATFORM_TRIPLET=darwin
165165diff --git a/configure b/configure
166- index d46bc563a67..d5cd81d16a8 100755
166+ index d0ae103014a..308124ef06d 100755
167167--- a/configure
168168+++ b/configure
169169@@ -974,6 +974,8 @@
@@ -588,7 +588,7 @@ index d46bc563a67..d5cd81d16a8 100755
588588 fi
589589 ac_fn_c_check_func "$LINENO" "pread" "ac_cv_func_pread"
590590 if test "x$ac_cv_func_pread" = xyes
591- @@ -19860 ,12 +19973 ,6 @@
591+ @@ -19866 ,12 +19979 ,6 @@
592592 then :
593593 printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h
594594
@@ -601,7 +601,7 @@ index d46bc563a67..d5cd81d16a8 100755
601601 fi
602602 ac_fn_c_check_func "$LINENO" "sigfillset" "ac_cv_func_sigfillset"
603603 if test "x$ac_cv_func_sigfillset" = xyes
604- @@ -20134 ,11 +20241 ,11 @@
604+ @@ -20140 ,11 +20247 ,11 @@
605605
606606 fi
607607
@@ -615,7 +615,7 @@ index d46bc563a67..d5cd81d16a8 100755
615615 ac_fn_c_check_func "$LINENO" "getentropy" "ac_cv_func_getentropy"
616616 if test "x$ac_cv_func_getentropy" = xyes
617617 then :
618- @@ -20160 ,6 +20267 ,53 @@
618+ @@ -20166 ,6 +20273 ,53 @@
619619
620620 fi
621621
@@ -669,7 +669,7 @@ index d46bc563a67..d5cd81d16a8 100755
669669 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5
670670 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }
671671 if test ${ac_cv_c_undeclared_builtin_options+y}
672- @@ -23242 ,7 +23396 ,8 @@
672+ @@ -23248 ,7 +23402 ,8 @@
673673
674674
675675 # check for openpty, login_tty, and forkpty
@@ -679,7 +679,7 @@ index d46bc563a67..d5cd81d16a8 100755
679679
680680 for ac_func in openpty
681681 do :
682- @@ -23356 ,7 +23511 ,7 @@
682+ @@ -23362 ,7 +23517 ,7 @@
683683 fi
684684
685685 done
@@ -688,15 +688,15 @@ index d46bc563a67..d5cd81d16a8 100755
688688 printf %s "checking for library containing login_tty... " >&6; }
689689 if test ${ac_cv_search_login_tty+y}
690690 then :
691- @@ -23539 ,6 +23694 ,7 @@
691+ @@ -23545 ,6 +23700 ,7 @@
692692 fi
693693
694694 done
695695+ fi
696696
697697 # check for long file support functions
698698 ac_fn_c_check_func "$LINENO" "fseek64" "ac_cv_func_fseek64"
699- @@ -23804 ,10 +23960 ,10 @@
699+ @@ -23810 ,10 +23966 ,10 @@
700700
701701 done
702702
@@ -709,7 +709,7 @@ index d46bc563a67..d5cd81d16a8 100755
709709 then
710710
711711 for ac_func in clock_settime
712- @@ -26146 ,8 +26302 ,8 @@
712+ @@ -26152 ,8 +26308 ,8 @@
713713 LIBPYTHON="\$(BLDLIBRARY)"
714714 fi
715715
@@ -720,7 +720,7 @@ index d46bc563a67..d5cd81d16a8 100755
720720 MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(PYTHONFRAMEWORKDIR)/\$(PYTHONFRAMEWORK)"
721721 fi
722722
723- @@ -29017 ,7 +29173 ,7 @@
723+ @@ -29023 ,7 +29179 ,7 @@
724724 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for device files" >&5
725725 printf "%s\n" "$as_me: checking for device files" >&6;}
726726
@@ -729,7 +729,7 @@ index d46bc563a67..d5cd81d16a8 100755
729729 ac_cv_file__dev_ptmx=no
730730 ac_cv_file__dev_ptc=no
731731 else
732- @@ -29510 ,7 +29666 ,7 @@
732+ @@ -29504 ,7 +29660 ,7 @@
733733 with_ensurepip=no ;; #(
734734 WASI) :
735735 with_ensurepip=no ;; #(
@@ -738,7 +738,7 @@ index d46bc563a67..d5cd81d16a8 100755
738738 with_ensurepip=no ;; #(
739739 *) :
740740 with_ensurepip=upgrade
741- @@ -30490 ,7 +30646 ,7 @@
741+ @@ -30484 ,7 +30640 ,7 @@
742742 ;; #(
743743 Darwin) :
744744 ;; #(
@@ -747,7 +747,7 @@ index d46bc563a67..d5cd81d16a8 100755
747747
748748
749749
750- @@ -34493 ,6 +34649 ,8 @@
750+ @@ -34487 ,6 +34643 ,8 @@
751751 "Mac/Resources/framework/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/framework/Info.plist" ;;
752752 "Mac/Resources/app/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/app/Info.plist" ;;
753753 "iOS/Resources/Info.plist") CONFIG_FILES="$CONFIG_FILES iOS/Resources/Info.plist" ;;
@@ -757,7 +757,7 @@ index d46bc563a67..d5cd81d16a8 100755
757757 "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;;
758758 "Misc/python-embed.pc") CONFIG_FILES="$CONFIG_FILES Misc/python-embed.pc" ;;
759759diff --git a/configure.ac b/configure.ac
760- index faa89095303..9bd51f7da97 100644
760+ index 8bb0f1c6ef4..bfd67de48bb 100644
761761--- a/configure.ac
762762+++ b/configure.ac
763763@@ -330,6 +330,12 @@
@@ -1128,7 +1128,7 @@ index faa89095303..9bd51f7da97 100644
11281128+ pipe2 plock poll posix_fadvise posix_fallocate posix_openpt \
11291129 pread preadv preadv2 process_vm_readv \
11301130 pthread_cond_timedwait_relative_np pthread_condattr_setclock pthread_init \
1131- pthread_kill pthread_getname_np pthread_setname_np \
1131+ pthread_kill pthread_getname_np pthread_setname_np pthread_getattr_np \
11321132@@ -5153,7 +5283,7 @@
11331133 sched_setparam sched_setscheduler sem_clockwait sem_getvalue sem_open \
11341134 sem_timedwait sem_unlink sendfile setegid seteuid setgid sethostname \
@@ -1232,7 +1232,7 @@ index faa89095303..9bd51f7da97 100644
12321232 ac_cv_file__dev_ptmx=no
12331233 ac_cv_file__dev_ptc=no
12341234 else
1235- @@ -7187 ,7 +7327 ,7 @@
1235+ @@ -7174 ,7 +7314 ,7 @@
12361236 AS_CASE([$ac_sys_system],
12371237 [Emscripten], [with_ensurepip=no],
12381238 [WASI], [with_ensurepip=no],
@@ -1241,7 +1241,7 @@ index faa89095303..9bd51f7da97 100644
12411241 [with_ensurepip=upgrade]
12421242 )
12431243 ])
1244- @@ -7598 ,7 +7738 ,7 @@
1244+ @@ -7585 ,7 +7725 ,7 @@
12451245 [VxWorks*], [PY_STDLIB_MOD_SET_NA([_scproxy], [termios], [grp])],
12461246 dnl The _scproxy module is available on macOS
12471247 [Darwin], [],
@@ -1270,141 +1270,6 @@ index c3e261ecd9e..26ef7a95de4 100644
12701270 <key>CFBundleSupportedPlatforms</key>
12711271 <array>
12721272 <string>iPhoneOS</string>
1273- diff --git a/iOS/testbed/__main__.py b/iOS/testbed/__main__.py
1274- index b4499f5ac17..d12a5ab065b 100644
1275- --- a/iOS/testbed/__main__.py
1276- +++ b/iOS/testbed/__main__.py
1277- @@ -82,19 +82,29 @@
1278-
1279- # Return a list of UDIDs associated with booted simulators
1280- async def list_devices():
1281- - # List the testing simulators, in JSON format
1282- - raw_json = await async_check_output(
1283- - "xcrun", "simctl", "--set", "testing", "list", "-j"
1284- - )
1285- - json_data = json.loads(raw_json)
1286- -
1287- - # Filter out the booted iOS simulators
1288- - return [
1289- - simulator["udid"]
1290- - for runtime, simulators in json_data["devices"].items()
1291- - for simulator in simulators
1292- - if runtime.split(".")[-1].startswith("iOS") and simulator["state"] == "Booted"
1293- - ]
1294- + try:
1295- + # List the testing simulators, in JSON format
1296- + raw_json = await async_check_output(
1297- + "xcrun", "simctl", "--set", "testing", "list", "-j"
1298- + )
1299- + json_data = json.loads(raw_json)
1300- +
1301- + # Filter out the booted iOS simulators
1302- + return [
1303- + simulator["udid"]
1304- + for runtime, simulators in json_data["devices"].items()
1305- + for simulator in simulators
1306- + if runtime.split(".")[-1].startswith("iOS") and simulator["state"] == "Booted"
1307- + ]
1308- + except subprocess.CalledProcessError as e:
1309- + # If there's no ~/Library/Developer/XCTestDevices folder (which is the
1310- + # case on fresh installs, and in some CI environments), `simctl list`
1311- + # returns error code 1, rather than an empty list. Handle that case,
1312- + # but raise all other errors.
1313- + if e.returncode == 1:
1314- + return []
1315- + else:
1316- + raise
1317-
1318-
1319- async def find_device(initial_devices):
1320- @@ -230,33 +240,69 @@
1321- shutil.copytree(source, target, symlinks=True)
1322- print(" done")
1323-
1324- + xc_framework_path = target / "Python.xcframework"
1325- + sim_framework_path = xc_framework_path / "ios-arm64_x86_64-simulator"
1326- if framework is not None:
1327- if framework.suffix == ".xcframework":
1328- print(" Installing XCFramework...", end="", flush=True)
1329- - xc_framework_path = (target / "Python.xcframework").resolve()
1330- if xc_framework_path.is_dir():
1331- shutil.rmtree(xc_framework_path)
1332- else:
1333- - xc_framework_path.unlink()
1334- + xc_framework_path.unlink(missing_ok=True)
1335- xc_framework_path.symlink_to(
1336- framework.relative_to(xc_framework_path.parent, walk_up=True)
1337- )
1338- print(" done")
1339- else:
1340- print(" Installing simulator framework...", end="", flush=True)
1341- - sim_framework_path = (
1342- - target / "Python.xcframework" / "ios-arm64_x86_64-simulator"
1343- - ).resolve()
1344- if sim_framework_path.is_dir():
1345- shutil.rmtree(sim_framework_path)
1346- else:
1347- - sim_framework_path.unlink()
1348- + sim_framework_path.unlink(missing_ok=True)
1349- sim_framework_path.symlink_to(
1350- framework.relative_to(sim_framework_path.parent, walk_up=True)
1351- )
1352- print(" done")
1353- else:
1354- - print(" Using pre-existing iOS framework.")
1355- + if (
1356- + xc_framework_path.is_symlink()
1357- + and not xc_framework_path.readlink().is_absolute()
1358- + ):
1359- + # XCFramework is a relative symlink. Rewrite the symlink relative
1360- + # to the new location.
1361- + print(" Rewriting symlink to XCframework...", end="", flush=True)
1362- + orig_xc_framework_path = (
1363- + source
1364- + / xc_framework_path.readlink()
1365- + ).resolve()
1366- + xc_framework_path.unlink()
1367- + xc_framework_path.symlink_to(
1368- + orig_xc_framework_path.relative_to(
1369- + xc_framework_path.parent, walk_up=True
1370- + )
1371- + )
1372- + print(" done")
1373- + elif (
1374- + sim_framework_path.is_symlink()
1375- + and not sim_framework_path.readlink().is_absolute()
1376- + ):
1377- + print(" Rewriting symlink to simulator framework...", end="", flush=True)
1378- + # Simulator framework is a relative symlink. Rewrite the symlink
1379- + # relative to the new location.
1380- + orig_sim_framework_path = (
1381- + source
1382- + / "Python.XCframework"
1383- + / sim_framework_path.readlink()
1384- + ).resolve()
1385- + sim_framework_path.unlink()
1386- + sim_framework_path.symlink_to(
1387- + orig_sim_framework_path.relative_to(
1388- + sim_framework_path.parent, walk_up=True
1389- + )
1390- + )
1391- + print(" done")
1392- + else:
1393- + print(" Using pre-existing iOS framework.")
1394-
1395- for app_src in apps:
1396- print(f" Installing app {app_src.name!r}...", end="", flush=True)
1397- @@ -372,8 +418,8 @@
1398-
1399- if context.subcommand == "clone":
1400- clone_testbed(
1401- - source=Path(__file__).parent,
1402- - target=Path(context.location),
1403- + source=Path(__file__).parent.resolve(),
1404- + target=Path(context.location).resolve(),
1405- framework=Path(context.framework).resolve() if context.framework else None,
1406- apps=[Path(app) for app in context.apps],
1407- )
14081273--- /dev/null
14091274+++ b/tvOS/README.rst
14101275@@ -0,0 +1,108 @@
0 commit comments