jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/709124 )
Change subject: [bugfix] Require 3.9.2 for collections.abc.Callable ......................................................................
[bugfix] Require 3.9.2 for collections.abc.Callable
Good catch by Xqt. Python 3.9.2 is required to use Callable from the collections.abc module...
https://stackoverflow.com/a/65858574
Change-Id: I66a1d20767739df0b5032eec7f4bea906e02dcfc --- M pywikibot/backports.py 1 file changed, 7 insertions(+), 2 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/backports.py b/pywikibot/backports.py index 9569b2a..43abbd4 100644 --- a/pywikibot/backports.py +++ b/pywikibot/backports.py @@ -63,7 +63,6 @@
if PYTHON_VERSION < (3, 9): from typing import ( - Callable, Dict, FrozenSet, Iterable, @@ -77,7 +76,7 @@ Tuple, ) else: - from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence + from collections.abc import Iterable, Iterator, Mapping, Sequence from re import Match, Pattern Dict = dict # type: ignore[misc] FrozenSet = frozenset # type: ignore[misc] @@ -86,6 +85,12 @@ Tuple = tuple # type: ignore[assignment]
+if PYTHON_VERSION < (3, 9, 2): + from typing import Callable +else: + from collections.abc import Callable + + # PEP 616 string methods if PYTHON_VERSION >= (3, 9): removeprefix = str.removeprefix # type: ignore[attr-defined]
pywikibot-commits@lists.wikimedia.org