python313Packages.fonttools: cherry-pick fix for Python 3.13.4 behavior change

This commit is contained in:
K900 2025-06-09 10:40:07 +03:00
parent d77667ce24
commit acd1fdacfa
2 changed files with 31 additions and 0 deletions

View file

@ -39,6 +39,12 @@ buildPythonPackage rec {
hash = "sha256-ZkC1+I2d9wY9J7IoCGHGWG2gOVN7wW274UpN1lQxmJY="; hash = "sha256-ZkC1+I2d9wY9J7IoCGHGWG2gOVN7wW274UpN1lQxmJY=";
}; };
patches = [
# https://github.com/fonttools/fonttools/pull/3855
# FIXME: remove when merged
./python-3.13.4.patch
];
build-system = [ build-system = [
setuptools setuptools
setuptools-scm setuptools-scm

View file

@ -0,0 +1,25 @@
diff --git a/Lib/fontTools/feaLib/ast.py b/Lib/fontTools/feaLib/ast.py
index efcce8c680..18e5a891d3 100644
--- a/Lib/fontTools/feaLib/ast.py
+++ b/Lib/fontTools/feaLib/ast.py
@@ -719,7 +719,8 @@ def __init__(self, prefix, glyphs, suffix, lookups, location=None):
for i, lookup in enumerate(lookups):
if lookup:
try:
- (_ for _ in lookup)
+ for _ in lookup:
+ break
except TypeError:
self.lookups[i] = [lookup]
@@ -777,7 +778,8 @@ def __init__(self, prefix, glyphs, suffix, lookups, location=None):
for i, lookup in enumerate(lookups):
if lookup:
try:
- (_ for _ in lookup)
+ for _ in lookup:
+ break
except TypeError:
self.lookups[i] = [lookup]