gh-104415: Fix refleak tests for `typing.ByteString` deprecation (#104416)

This commit is contained in:
Nikita Sobolev 2023-05-12 15:36:12 +03:00 committed by GitHub
parent d50c37d8ad
commit 5b8cd5abe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -3586,3 +3586,12 @@ def __getattr__(attr):
) )
return ByteString return ByteString
raise AttributeError(f"module 'typing' has no attribute {attr!r}") 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)