gentoo/dev-python/rope/files/rope-1.13.0-python3.13.patch
Nowa Ammerlaan 9eca25c48c
dev-python/rope: patch and enable python3.13
Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org>
2025-01-02 16:19:52 +01:00

56 lines
1.8 KiB
Diff

diff --git a/rope/base/oi/type_hinting/utils.py b/rope/base/oi/type_hinting/utils.py
index b0a7aff97..2381c8472 100644
--- a/rope/base/oi/type_hinting/utils.py
+++ b/rope/base/oi/type_hinting/utils.py
@@ -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
@@ -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:
diff --git a/rope/contrib/autoimport/sqlite.py b/rope/contrib/autoimport/sqlite.py
index 54a6d03cf..f06fdaca3 100644
--- a/rope/contrib/autoimport/sqlite.py
+++ b/rope/contrib/autoimport/sqlite.py
@@ -569,14 +569,17 @@ def filter_folders(folder: Path) -> bool:
return list(OrderedDict.fromkeys(folder_paths))
def _safe_iterdir(self, folder: Path):
- dirs = folder.iterdir()
- while True:
- try:
- yield next(dirs)
- except PermissionError:
- pass
- except StopIteration:
- break
+ try:
+ dirs = folder.iterdir()
+ while True:
+ try:
+ yield next(dirs)
+ except PermissionError:
+ pass
+ except StopIteration:
+ break
+ except PermissionError:
+ pass
def _get_available_packages(self) -> List[Package]:
packages: List[Package] = [