Skip to content

Commit

Permalink
backports: remove deprecation and declare not public API
Browse files Browse the repository at this point in the history
Change-Id: I809b5e582d9d3d74bb775c420b061ea7810a3bbf
  • Loading branch information
JJMC89 committed Dec 31, 2024
1 parent 8a29d90 commit 48d8a4b
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions pywikibot/backports.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""This module contains backports to support older Python versions.
.. deprecated:: 9.0
The *nullcontext* context manager; use ``contextlib.nullcontext``
instead. The *SimpleQueue* queue; use ``queue.SimpleQueue`` instead.
This module is not part of the public pywikibot API. Breaking changes may be
made at any time, and the module is not subject to deprecation requirements.
"""
#
# (C) Pywikibot team, 2014-2024
Expand Down Expand Up @@ -203,16 +202,3 @@ def batched(iterable, n: int, *,
yield group
else:
from itertools import batched # type: ignore[no-redef]


# import ModuleDeprecationWrapper here to prevent circular import
from pywikibot.tools import ModuleDeprecationWrapper # noqa: E402


wrapper = ModuleDeprecationWrapper(__name__)
wrapper.add_deprecated_attr('nullcontext',
replacement_name='contextlib.nullcontext',
since='9.0.0')
wrapper.add_deprecated_attr('SimpleQueue',
replacement_name='queue.SimpleQueue',
since='9.0.0')

0 comments on commit 48d8a4b

Please sign in to comment.