forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-91896: Improve visibility of
ByteString
deprecation warnings
- Loading branch information
1 parent
1f56795
commit 424486a
Showing
4 changed files
with
75 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters