PyYAML/Fix-build-Error-due-to-cython-updated.patch
2024-02-07 10:10:14 +08:00

30 lines
881 B
Diff

From 293a0cead0d90fb19cbfa0e4138f0b3886414b92 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 31 Jan 2024 09:57:35 +0800
Subject: [PATCH] fix build Error due to cython updated
---
setup.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 65b0ea0..4461580 100644
--- a/setup.py
+++ b/setup.py
@@ -82,7 +82,11 @@ if 'sdist' in sys.argv or os.environ.get('PYYAML_FORCE_CYTHON') == '1':
with_cython = True
try:
from Cython.Distutils.extension import Extension as _Extension
- from Cython.Distutils import build_ext as _build_ext
+ try:
+ from Cython.Distutils.old_build_ext import old_build_ext as _build_ext
+ except ImportError:
+ from Cython.Distutils import build_ext as _build_ext
+
with_cython = True
except ImportError:
if with_cython:
--
2.33.0