From b53d56f0d258c6c1b030328d73e829bdd5590ffa Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Aug 05 2021 06:42:36 +0000 Subject: Fix compatibility with Python 3.10rc1 --- diff --git a/py3.10_inspect_fix.patch b/py3.10_inspect_fix.patch new file mode 100644 index 0000000..74ace31 --- /dev/null +++ b/py3.10_inspect_fix.patch @@ -0,0 +1,27 @@ +From 8f7d45117e278768d733b6a52dd49031eb5f50f7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lum=C3=ADr=20=27Frenzy=27=20Balhar?= + +Date: Thu, 5 Aug 2021 08:24:35 +0200 +Subject: [PATCH] inspect now raises OSError for objects without source file + +CPython issue: https://bugs.python.org/issue44648 +--- + jedi/inference/compiled/mixed.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/jedi/inference/compiled/mixed.py b/jedi/inference/compiled/mixed.py +index 43e0ed6c..b323d70e 100644 +--- a/jedi/inference/compiled/mixed.py ++++ b/jedi/inference/compiled/mixed.py +@@ -187,7 +187,7 @@ def _find_syntax_node_name(inference_state, python_object): + try: + python_object = _get_object_to_check(python_object) + path = inspect.getsourcefile(python_object) +- except TypeError: ++ except (OSError, TypeError): + # The type might not be known (e.g. class_with_dict.__weakref__) + return None + path = None if path is None else Path(path) +-- +2.31.1 + diff --git a/python-jedi.spec b/python-jedi.spec index 531338f..07f8856 100644 --- a/python-jedi.spec +++ b/python-jedi.spec @@ -18,7 +18,7 @@ than all other static analysis frameworks for Python.} Name: python-jedi Version: %{baseversion} -Release: 5%{?dist} +Release: 6%{?dist} Summary: An auto completion tool for Python that can be used for text editors # jedi is MIT @@ -32,6 +32,9 @@ Source1: https://github.com/davidhalter/django-stubs/archive/%{django_stu Source2: https://github.com/davidhalter/typeshed/archive/%{typeshed_commit}/typeshed-%{typeshed_commit}.tar.gz BuildArch: noarch +# Fix compatibility with Python 3.10rc1 +# Proposed upstream: https://github.com/davidhalter/jedi/pull/1795 +Patch0: py3.10_inspect_fix.patch %description %{common_description} @@ -92,6 +95,9 @@ cp -p jedi/third_party/typeshed/LICENSE LICENSE-typeshed.txt %changelog +* Thu Aug 05 2021 Lumír Balhar - 0.18.0-6 +- Fix compatibility with Python 3.10rc1 + * Sun Aug 01 2021 Lumír Balhar - 0.18.0-5 - Skip some tests causing FTBFS with Python 3.10