]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-116622: Make test_unzip_zipfile recognize Android error message format...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 30 Sep 2024 01:03:12 +0000 (03:03 +0200)
committerGitHub <noreply@github.com>
Mon, 30 Sep 2024 01:03:12 +0000 (18:03 -0700)
gh-116622: Make test_unzip_zipfile recognize Android error message format (GH-124462)

Make test_unzip_zipfile recognize Android error message format
(cherry picked from commit 461c12b43870d51ea29eae7b0969b20565d50eb6)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Lib/test/test_shutil.py

index bccb81e0737c5709a9bac5af2434e8acace5ce1e..91239ce2d9501713a94edcc7683c62dd7069644f 100644 (file)
@@ -1911,7 +1911,10 @@ class TestArchives(BaseTest, unittest.TestCase):
                 subprocess.check_output(zip_cmd, stderr=subprocess.STDOUT)
             except subprocess.CalledProcessError as exc:
                 details = exc.output.decode(errors="replace")
-                if 'unrecognized option: t' in details:
+                if any(message in details for message in [
+                    'unrecognized option: t',  # BusyBox
+                    'invalid option -- t',  # Android
+                ]):
                     self.skipTest("unzip doesn't support -t")
                 msg = "{}\n\n**Unzip Output**\n{}"
                 self.fail(msg.format(exc, details))