From 89a6f9f07897b41bc0106f0775b1d73fd1b645a3 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Tue, 10 Oct 2023 14:30:37 +0100 Subject: [PATCH] allows system cython packages to work --- build/pkgs/cython/patches/5690.patch | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 build/pkgs/cython/patches/5690.patch diff --git a/build/pkgs/cython/patches/5690.patch b/build/pkgs/cython/patches/5690.patch new file mode 100644 index 00000000000..cc927879e1f --- /dev/null +++ b/build/pkgs/cython/patches/5690.patch @@ -0,0 +1,48 @@ +diff --git a/Cython/Debugger/DebugWriter.py b/Cython/Debugger/DebugWriter.py +index 8b1fb75b027..2c3c310fc64 100644 +--- a/Cython/Debugger/DebugWriter.py ++++ b/Cython/Debugger/DebugWriter.py +@@ -18,6 +18,21 @@ + etree = None + + from ..Compiler import Errors ++from ..Compiler.StringEncoding import EncodedString ++ ++ ++def is_valid_tag(name): ++ """ ++ Names like '.0' are used internally for arguments ++ to functions creating generator expressions, ++ however they are not identifiers. ++ ++ See https://github.com/cython/cython/issues/5552 ++ """ ++ if isinstance(name, EncodedString): ++ if name.startswith(".") and name[1:].isdecimal(): ++ return False ++ return True + + + class CythonDebugWriter(object): +@@ -39,14 +54,17 @@ def __init__(self, output_dir): + self.start('cython_debug', attrs=dict(version='1.0')) + + def start(self, name, attrs=None): +- self.tb.start(name, attrs or {}) ++ if is_valid_tag(name): ++ self.tb.start(name, attrs or {}) + + def end(self, name): +- self.tb.end(name) ++ if is_valid_tag(name): ++ self.tb.end(name) + + def add_entry(self, name, **attrs): +- self.tb.start(name, attrs) +- self.tb.end(name) ++ if is_valid_tag(name): ++ self.tb.start(name, attrs) ++ self.tb.end(name) + + def serialize(self): + self.tb.end('Module')