105 if pending and removal:
106 msg = "A pending deprecation cannot have a scheduled removal"
107▶ raise ValueError(msg)
108 if alternative and alternative_import:
109 msg = "Cannot specify both alternative and alternative_import"
· · ·
110▶ raise ValueError(msg)
111
112 if alternative_import and "." not in alternative_import:
· · ·
115 f" {alternative_import}"
116 )
117▶ raise ValueError(msg)
118
119
· · ·
259 """Finalize the deprecation of a class."""
260 # Can't set new_doc on some extension objects.
261▶ with contextlib.suppress(AttributeError):
262 obj.__doc__ = new_doc
263
· · ·
290 if not _name:
291 msg = f"Field {obj} must have a name to be deprecated."
292▶ raise ValueError(msg)
293 old_doc = obj.description
294
+ 2 more matches in this file