Skip to content

Commit

Permalink
type_hinting/utils.py: python3.13 removes collections.abc
Browse files Browse the repository at this point in the history
instead use _collections_abc for the alias

Bug: python-rope#801
Signed-off-by: Nowa Ammerlaan <[email protected]>
  • Loading branch information
Nowa-Ammerlaan committed Jan 2, 2025
1 parent 55169bb commit 8bb4ac0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rope/base/oi/type_hinting/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import logging
import sys
from typing import TYPE_CHECKING, Optional, Union

import rope.base.utils as base_utils
Expand Down Expand Up @@ -81,7 +82,10 @@ def resolve_type(
"""
Find proper type object from its name.
"""
deprecated_aliases = {"collections": "collections.abc"}
if sys.version_info < (3, 13):
deprecated_aliases = {"collections": "collections.abc"}
else:
deprecated_aliases = {"collections": "_collections_abc"}
ret_type = None
logging.debug("Looking for %s", type_name)
if "." not in type_name:
Expand Down

0 comments on commit 8bb4ac0

Please sign in to comment.