GH-127807: pathlib ABCs: remove PathBase._unsupported_msg() (#127855)

This method helped us customise the `UnsupportedOperation` message
depending on the type. But we're aiming to make `PathBase` a proper ABC
soon, so `NotImplementedError` is the right exception to raise there.
This commit is contained in:
Barney Gale 2024-12-12 17:39:24 +00:00 committed by GitHub
parent 487fdbed40
commit 7146f18946
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 52 additions and 44 deletions

View file

@ -63,6 +63,14 @@ def needs_symlinks(fn):
_tests_needing_symlinks.add(fn.__name__)
return fn
class UnsupportedOperationTest(unittest.TestCase):
def test_is_notimplemented(self):
self.assertTrue(issubclass(pathlib.UnsupportedOperation, NotImplementedError))
self.assertTrue(isinstance(pathlib.UnsupportedOperation(), NotImplementedError))
#
# Tests for the pure classes.
#