diff --git a/Lib/typing.py b/Lib/typing.py index bf7bd241972a6b..513d4d96dd6e1d 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -3586,3 +3586,12 @@ def __getattr__(attr): ) return ByteString raise AttributeError(f"module 'typing' has no attribute {attr!r}") + + +def _remove_cached_ByteString_from_globals(): + try: + del globals()["ByteString"] + except KeyError: + pass + +_cleanups.append(_remove_cached_ByteString_from_globals)