Skip to content
Snippets Groups Projects
Commit 5264cd7c authored by Thomas Gibson's avatar Thomas Gibson
Browse files

Add @alexfikl's patch for raising deprecation warnings

parent 4ce83cb1
No related branches found
No related tags found
No related merge requests found
......@@ -306,9 +306,24 @@ def as_dofdesc(dd):
# {{{ Deprecated tags
# FIXME: These are deprecated and will be removed
QTAG_NONE = DISCR_TAG_BASE
QTAG_MODAL = DISCR_TAG_MODAL
_deprecated_names = {"QTAG_NONE": "DISCR_TAG_BASE",
"QTAG_MODAL": "DISCR_TAG_MODAL"}
def __getattr__(name):
if name in _deprecated_names:
warn(f"{name} is deprecated and will be dropped "
f"in version 2022.x. Use {_deprecated_names[name]} instead.",
DeprecationWarning, stacklevel=2)
return globals()[f"{_deprecated_names[name]}"]
raise AttributeError(f"module {__name__} has no attribute {name}")
import sys
if sys.version_info < (3, 7):
QTAG_NONE = DISCR_TAG_BASE
QTAG_MODAL = DISCR_TAG_MODAL
# }}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment