From 458fd73bcfca8f1500880098074b3b29d27a2fdc Mon Sep 17 00:00:00 2001 From: Harmon Date: Thu, 18 Aug 2022 08:53:02 -0500 Subject: [PATCH] Fix handling of StreamRule in list passed to delete_rules Resolves #1942 --- tweepy/asynchronous/streaming.py | 2 +- tweepy/streaming.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tweepy/asynchronous/streaming.py b/tweepy/asynchronous/streaming.py index ea7dd2c..25a544b 100644 --- a/tweepy/asynchronous/streaming.py +++ b/tweepy/asynchronous/streaming.py @@ -679,7 +679,7 @@ class AsyncStreamingClient(AsyncBaseClient, AsyncBaseStream): ids = (ids,) for id in ids: if isinstance(id, StreamRule): - json["delete"]["ids"].append(str(StreamRule.id)) + json["delete"]["ids"].append(str(id.id)) else: json["delete"]["ids"].append(str(id)) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 041f3eb..2fff781 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -696,7 +696,7 @@ class StreamingClient(BaseClient, BaseStream): ids = (ids,) for id in ids: if isinstance(id, StreamRule): - json["delete"]["ids"].append(str(StreamRule.id)) + json["delete"]["ids"].append(str(id.id)) else: json["delete"]["ids"].append(str(id)) -- 2.25.1