Fix handling of StreamRule in list passed to delete_rules
authorHarmon <Harmon758@gmail.com>
Thu, 18 Aug 2022 13:53:02 +0000 (08:53 -0500)
committerHarmon <Harmon758@gmail.com>
Thu, 18 Aug 2022 13:53:57 +0000 (08:53 -0500)
Resolves #1942

tweepy/asynchronous/streaming.py
tweepy/streaming.py

index ea7dd2c4407eeb47f48db3bb116155c9199d1ec1..25a544b8a40a290f321cc6b80ebf0cd334bdecea 100644 (file)
@@ -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))
 
index 041f3eb8f2d887c8311f63f01669f23ebef762b8..2fff7812bab162b4c1aa857a88e09fd99006d62d 100644 (file)
@@ -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))