Skip to content

Commit

Permalink
use getattr over getattribute
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGrace2282 committed Oct 19, 2024
1 parent 482f622 commit fff3921
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions manim/mobject/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,10 @@ class _UpdaterBuilder(Generic[T_co]):
def __init__(self, mobject: T_co):
self._mobject = mobject

def __getattribute__(self, name: str, /):
def __getattr__(self, name: str, /):
# just return a function that will add the updater
def add_updater(*method_args, **method_kwargs):
# use object __getattr__ to avoid infinite recursion
mob = object.__getattribute__(self, "_mobject")
mob.add_updater(
self._mobject.add_updater(
lambda m: getattr(m, name)(*method_args, **method_kwargs),
call_updater=True,
)
Expand Down

0 comments on commit fff3921

Please sign in to comment.