[3.13] gh-116622: Fix testPyObjectPrintOSError on Android (GH-122487) (#122490)

gh-116622: Fix testPyObjectPrintOSError on Android (GH-122487)

Adds extra handling for way BSD/Android return errors from calls to fwrite.
(cherry picked from commit 82db572813)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
This commit is contained in:
Miss Islington (bot) 2024-07-31 02:49:14 +02:00 committed by GitHub
parent a21317f07b
commit 5212624c42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 39 additions and 9 deletions

View file

@ -7,10 +7,17 @@ plugins {
val PYTHON_DIR = File(projectDir, "../../..").canonicalPath
val PYTHON_CROSS_DIR = "$PYTHON_DIR/cross-build"
val ABIS = mapOf(
"arm64-v8a" to "aarch64-linux-android",
"x86_64" to "x86_64-linux-android",
)
).filter { File("$PYTHON_CROSS_DIR/${it.value}").exists() }
if (ABIS.isEmpty()) {
throw GradleException(
"No Android ABIs found in $PYTHON_CROSS_DIR: see Android/README.md " +
"for building instructions."
)
}
val PYTHON_VERSION = File("$PYTHON_DIR/Include/patchlevel.h").useLines {
for (line in it) {