From b8cc0043d46318c7e11952109450587bee9567ab Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Fri, 17 Dec 2021 18:32:03 -0800 Subject: [PATCH] Fix maximum recursion depth error when generating documentation Troubleshooting an issue with Senlin documentation, > RecursionError: maximum recursion depth exceeded in __instancecheck__ it turns out that attrs['base_options'] creates a recursive reference when no base classes have 'base_options'. This happens when BaseAction is created. Closes-Bug: #1955773 Change-Id: I2724f07339134b3e06b7ea925939bf7072162106 --- horizon/tables/actions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/horizon/tables/actions.py b/horizon/tables/actions.py index 25c452392f..ad8945a4f5 100644 --- a/horizon/tables/actions.py +++ b/horizon/tables/actions.py @@ -52,7 +52,10 @@ class BaseActionMetaClass(type): # Options of action are set as class attributes, loading them. options = {} if attrs: - options = attrs + # NOTE: It is required to create a new dict object + # to avoid a recursive reference when no parent class + # has 'base_options' attribute. + options = dict(attrs) # Iterate in reverse to preserve final order for base in bases[::-1]: