From f32ca91ef081ab71d9dd7c09288e0abeb2ba1c31 Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Tue, 1 Oct 2024 17:39:15 +0000 Subject: recipe: Fix Python 3.13 compatibility Python 3.13 adds a predefined instance variable, `__static_attributes__`, that matches the expected syntax for build steps' identification. See https://docs.python.org/3.13/whatsnew/3.13.html#summary-release-highlights Co-Authored-by: Nirbheek Chauhan Part-of: --- cerbero/build/recipe.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cerbero/build/recipe.py b/cerbero/build/recipe.py index 97cd1f57..6bb1769f 100644 --- a/cerbero/build/recipe.py +++ b/cerbero/build/recipe.py @@ -165,7 +165,9 @@ class BuildSteps(object): @classmethod def all_names(cls): - members = inspect.getmembers(cls, lambda x: isinstance(x, tuple)) + # In 3.13, __static_attributes__ is a new tuple attribute. Just ignore + # all attributes starting with __. + members = inspect.getmembers(cls, lambda x: isinstance(x, tuple) and x and not x[0].startswith('__')) return tuple(e[1][1] for e in members) -- cgit v1.2.3