From 7bdf79dee50304b3a2874e3846870587a29416ee Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 22 Jan 2023 15:10:25 +0000 Subject: [PATCH] python: do not shadow variables to fix pyright warnings --- python/src/deltachat/account.py | 6 +++--- python/src/deltachat/chat.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/src/deltachat/account.py b/python/src/deltachat/account.py index e6749c7ba..b1b08b43b 100644 --- a/python/src/deltachat/account.py +++ b/python/src/deltachat/account.py @@ -284,9 +284,9 @@ class Account: :returns: :class:`deltachat.contact.Contact` instance. """ (name, addr) = self.get_contact_addr_and_name(obj, name) - name = as_dc_charpointer(name) - addr = as_dc_charpointer(addr) - contact_id = lib.dc_create_contact(self._dc_context, name, addr) + name_c = as_dc_charpointer(name) + addr_c = as_dc_charpointer(addr) + contact_id = lib.dc_create_contact(self._dc_context, name_c, addr_c) return Contact(self, contact_id) def get_contact(self, obj) -> Optional[Contact]: diff --git a/python/src/deltachat/chat.py b/python/src/deltachat/chat.py index 77fac073d..e666b6cd4 100644 --- a/python/src/deltachat/chat.py +++ b/python/src/deltachat/chat.py @@ -162,8 +162,8 @@ class Chat: :param name: as a unicode string. :returns: True on success, False otherwise """ - name = as_dc_charpointer(name) - return bool(lib.dc_set_chat_name(self.account._dc_context, self.id, name)) + name_c = as_dc_charpointer(name) + return bool(lib.dc_set_chat_name(self.account._dc_context, self.id, name_c)) def get_color(self): """return the color of the chat.