Skip to content

Commit 56c0083

Browse files
berlanderic-wieser
andauthored
Update Lib/test/test_shutil.py
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
1 parent f628f8f commit 56c0083

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/test/test_shutil.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,13 +1127,13 @@ def _assert_are_the_same_file_is_raised(self):
11271127
with self.assertRaises(Error) as cm:
11281128
yield
11291129

1130-
self.assertEqual(len(cm.exception.args[0]), 1)
1130+
errors = cm.exception.args[0]
1131+
self.assertEqual(len(errors), 1)
1132+
_, _, why = errors[0]
11311133
if sys.platform == "win32":
1132-
self.assertIn(
1133-
"it is being used by another process", cm.exception.args[0][0][2]
1134-
)
1134+
self.assertIn("it is being used by another process", why)
11351135
else:
1136-
self.assertIn("are the same file", cm.exception.args[0][0][2])
1136+
self.assertIn("are the same file", why)
11371137

11381138

11391139
class TestCopy(BaseTest, unittest.TestCase):

0 commit comments

Comments
 (0)