Skip to content

Commit 54fcccf

Browse files
committed
Replace regex with a simple list of strings
1 parent 18656fc commit 54fcccf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/test/test_shutil.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import pathlib
1414
import subprocess
1515
import random
16-
import re
1716
import string
1817
import contextlib
1918
import io
@@ -1910,7 +1909,10 @@ def test_unzip_zipfile(self):
19101909
subprocess.check_output(zip_cmd, stderr=subprocess.STDOUT)
19111910
except subprocess.CalledProcessError as exc:
19121911
details = exc.output.decode(errors="replace")
1913-
if re.search(r'(unrecognized|invalid) option(:| --) t', details):
1912+
if any(message in details for message in [
1913+
'unrecognized option: t', # Info-ZIP
1914+
'invalid option -- t', # Android
1915+
]):
19141916
self.skipTest("unzip doesn't support -t")
19151917
msg = "{}\n\n**Unzip Output**\n{}"
19161918
self.fail(msg.format(exc, details))

0 commit comments

Comments
 (0)