mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-91896: Improve visibility of ByteString
deprecation warnings (#104294)
This commit is contained in:
parent
a0a98ddb31
commit
f0f5bb3204
5 changed files with 85 additions and 12 deletions
|
@ -1,3 +1,12 @@
|
|||
from _collections_abc import *
|
||||
from _collections_abc import __all__
|
||||
from _collections_abc import _CallableGenericAlias
|
||||
|
||||
_deprecated_ByteString = globals().pop("ByteString")
|
||||
|
||||
def __getattr__(attr):
|
||||
if attr == "ByteString":
|
||||
import warnings
|
||||
warnings._deprecated("collections.abc.ByteString", remove=(3, 14))
|
||||
return _deprecated_ByteString
|
||||
raise AttributeError(f"module 'collections.abc' has no attribute {attr!r}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue