File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -6004,17 +6004,16 @@ def test_mutablesequence(self):
6004
6004
self .assertNotIsInstance ((), typing .MutableSequence )
6005
6005
6006
6006
def test_bytestring (self ):
6007
- _typing = import_fresh_module ('typing' )
6008
6007
with self .assertWarns (DeprecationWarning ):
6009
- ByteString = _typing . ByteString
6008
+ from typing import ByteString
6010
6009
with self .assertWarns (DeprecationWarning ):
6011
6010
self .assertIsInstance (b'' , ByteString )
6012
6011
with self .assertWarns (DeprecationWarning ):
6013
6012
self .assertIsInstance (bytearray (b'' ), ByteString )
6014
6013
with self .assertWarns (DeprecationWarning ):
6015
6014
class Foo (ByteString ): ...
6016
6015
with self .assertWarns (DeprecationWarning ):
6017
- class Bar (ByteString , _typing .Awaitable ): ...
6016
+ class Bar (ByteString , typing .Awaitable ): ...
6018
6017
6019
6018
def test_list (self ):
6020
6019
self .assertIsSubclass (list , typing .List )
Original file line number Diff line number Diff line change @@ -3586,3 +3586,12 @@ def __getattr__(attr):
3586
3586
)
3587
3587
return ByteString
3588
3588
raise AttributeError (f"module 'typing' has no attribute { attr !r} " )
3589
+
3590
+
3591
+ def _remove_cached_ByteString_from_globals ():
3592
+ try :
3593
+ del globals ()["ByteString" ]
3594
+ except KeyError :
3595
+ pass
3596
+
3597
+ _cleanups .append (_remove_cached_ByteString_from_globals )
You can’t perform that action at this time.
0 commit comments