Skip to content

Commit 77b7f83

Browse files
committed
Adjust expected exceptions
1 parent 12cd9e1 commit 77b7f83

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/test/test_codecs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2828,8 +2828,9 @@ def test_custom_zlib_error_is_noted(self):
28282828

28292829
def test_custom_hex_error_is_noted(self):
28302830
# Check hex codec gives a good error for malformed input
2831+
import binascii
28312832
msg = "decoding with 'hex_codec' codec failed"
2832-
with self.assertRaises(zlib.error) as failure:
2833+
with self.assertRaises(binascii.Error) as failure:
28332834
codecs.decode(b"hello", "hex_codec")
28342835
self.assertEqual(msg, failure.exception.__notes__[0])
28352836

Lib/test/test_shutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2738,7 +2738,7 @@ def test_regular_copy(self):
27382738
def test_same_file(self):
27392739
self.addCleanup(self.reset)
27402740
with self.get_files() as (src, dst):
2741-
with self.assertRaises(OSError):
2741+
with self.assertRaises((OSError, _GiveupOnFastCopy)):
27422742
self.zerocopy_fun(src, src)
27432743
# Make sure src file is not corrupted.
27442744
self.assertEqual(read_file(TESTFN, binary=True), self.FILEDATA)

0 commit comments

Comments
 (0)