From daab0efed5e3d7ef98e06adcec0ca54982a91685 Mon Sep 17 00:00:00 2001 From: vmphase Date: Thu, 20 Aug 2026 18:33:04 +0300 Subject: [PATCH] fix(modal): use _weights instead of __weights in remove_item() --- CHANGELOG.md | 2 ++ discord/ui/modal.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d407f3758..4f1005d739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#3320](https://github.com/Pycord-Development/pycord/pull/3320)) - Fix `SyntaxWarning` about `return` in a `finally` block raised on Python 3.14+ ([#3332](https://github.com/Pycord-Development/pycord/pull/3334)) +- Fixed `AttributeError` when using `Modal.remove_item()`. + ([#3357](https://github.com/Pycord-Development/pycord/pull/3357)) ### Deprecated diff --git a/discord/ui/modal.py b/discord/ui/modal.py index bb5fabc8ee..8b35ecd889 100644 --- a/discord/ui/modal.py +++ b/discord/ui/modal.py @@ -360,7 +360,7 @@ def remove_item(self, item: InputText) -> Self: super().remove_item(item) try: - self.__weights.remove_item(item) + self._weights.remove_item(item) except ValueError: pass return self