Stop checking Client request parameter name when converting to datetime
authorHarmon <Harmon758@gmail.com>
Wed, 29 Sep 2021 05:22:45 +0000 (00:22 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 29 Sep 2021 05:22:45 +0000 (00:22 -0500)
tweepy/client.py

index e3b445b6494e8ebdaea40fe7b17e2e1c2ad09cc3..1077e174f6e5a6df7ff3891034b94d6a015d30bf 100644 (file)
@@ -143,7 +143,7 @@ class Client:
 
             if isinstance(param_value, list):
                 request_params[param_name] = ','.join(map(str, param_value))
-            elif param_name in ("start_time", "end_time") and isinstance(param_value, datetime.datetime):
+            elif isinstance(param_value, datetime.datetime):
                 if param_value.tzinfo is not None:
                     param_value = param_value.astimezone(datetime.timezone.utc)
                 request_params[param_name] = param_value.strftime("%Y-%m-%dT%H:%M:%S.%fZ")