Skip to content

Commit 8bb4ac0

Browse files
type_hinting/utils.py: python3.13 removes collections.abc
instead use _collections_abc for the alias Bug: #801 Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org>
1 parent 55169bb commit 8bb4ac0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

rope/base/oi/type_hinting/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import logging
4+
import sys
45
from typing import TYPE_CHECKING, Optional, Union
56

67
import rope.base.utils as base_utils
@@ -81,7 +82,10 @@ def resolve_type(
8182
"""
8283
Find proper type object from its name.
8384
"""
84-
deprecated_aliases = {"collections": "collections.abc"}
85+
if sys.version_info < (3, 13):
86+
deprecated_aliases = {"collections": "collections.abc"}
87+
else:
88+
deprecated_aliases = {"collections": "_collections_abc"}
8589
ret_type = None
8690
logging.debug("Looking for %s", type_name)
8791
if "." not in type_name:

0 commit comments

Comments
 (0)