Fix setuptools.depends:get_module_constant() on Python 3.13.0a1
This commit is contained in:
parent
5cfff4defd
commit
134fa771d6
30
4094.patch
Normal file
30
4094.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 29f052da470ac281f15d87d4a40511b5cd1e4834 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||
Date: Thu, 26 Oct 2023 14:55:12 +0200
|
||||
Subject: [PATCH] Fix setuptools.depends:get_module_constant() on Python
|
||||
3.13.0a1
|
||||
|
||||
Don't hardcode opcode numbers, look them up instead.
|
||||
|
||||
Fixes https://github.com/pypa/setuptools/issues/4090
|
||||
---
|
||||
setuptools/depends.py | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/setuptools/depends.py b/setuptools/depends.py
|
||||
index 180e820459..42907d9bd4 100644
|
||||
--- a/setuptools/depends.py
|
||||
+++ b/setuptools/depends.py
|
||||
@@ -142,9 +142,9 @@ def extract_constant(code, symbol, default=-1):
|
||||
|
||||
name_idx = list(code.co_names).index(symbol)
|
||||
|
||||
- STORE_NAME = 90
|
||||
- STORE_GLOBAL = 97
|
||||
- LOAD_CONST = 100
|
||||
+ STORE_NAME = dis.opmap['STORE_NAME']
|
||||
+ STORE_GLOBAL = dis.opmap['STORE_GLOBAL']
|
||||
+ LOAD_CONST = dis.opmap['LOAD_CONST']
|
||||
|
||||
const = default
|
||||
|
@ -52,6 +52,9 @@ Patch: Adjust-the-setup.py-install-deprecation-message.patch
|
||||
# away from pkg_resources.
|
||||
Patch: Remove-warning-from-pkg_resources.patch
|
||||
|
||||
# Fix setuptools.depends:get_module_constant() on Python 3.13.0a1
|
||||
Patch: https://github.com/pypa/setuptools/pull/4094.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python%{python3_pkgversion}-devel
|
||||
|
Loading…
Reference in New Issue
Block a user