File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -7510,6 +7510,10 @@ def test_bytestring(self):
75107510 self .assertIsInstance (b'' , ByteString )
75117511 with self .assertWarns (DeprecationWarning ):
75127512 self .assertIsInstance (bytearray (b'' ), ByteString )
7513+ with self .assertWarns (DeprecationWarning ):
7514+ self .assertIsSubclass (bytes , ByteString )
7515+ with self .assertWarns (DeprecationWarning ):
7516+ self .assertIsSubclass (bytearray , ByteString )
75137517 with self .assertWarns (DeprecationWarning ):
75147518 class Foo (ByteString ): ...
75157519 with self .assertWarns (DeprecationWarning ):
Original file line number Diff line number Diff line change @@ -3806,6 +3806,13 @@ def __instancecheck__(self, inst):
38063806 )
38073807 return super ().__instancecheck__ (inst )
38083808
3809+ def __subclasscheck__ (self , cls ):
3810+ import warnings
3811+ warnings ._deprecated (
3812+ f"{ self .__module__ } .{ self ._name } " , remove = self ._removal_version
3813+ )
3814+ return super ().__subclasscheck__ (cls )
3815+
38093816 with warnings .catch_warnings (
38103817 action = "ignore" , category = DeprecationWarning
38113818 ):
You can’t perform that action at this time.
0 commit comments