kopia lustrzana https://github.com/halcy/Mastodon.py
fix(statuses): prevent dynamic changes to `keyword_args`
The use of `locals()` in status_reply caused issues due to its dynamic nature. When `user_id = self.__get_logged_in_id()` was executed, `locals()` dynamically updated `keyword_args` to include the `self` reference again, even after it was explicitly deleted. This led to a TypeError: `Mastodon.status_post() got multiple values for argument 'self'`. This commit resolves the issue by replacing `keyword_args = locals()` with `keyword_args = locals().copy()`. By creating a static copy of the local variables at the time of execution, it prevents unintended modifications caused by dynamic changes to the local scope. Fixed #388pull/389/head
rodzic
47aa316c36
commit
02dd7967cb
|
@ -332,7 +332,7 @@ class Mastodon(Internals):
|
|||
are replying to, removing every other mentioned user from the
|
||||
conversation.
|
||||
"""
|
||||
keyword_args = locals()
|
||||
keyword_args = locals().copy()
|
||||
del keyword_args["self"]
|
||||
del keyword_args["to_status"]
|
||||
del keyword_args["untag"]
|
||||
|
|
Ładowanie…
Reference in New Issue