Improve TypeError message for API initialization
authorHarmon <Harmon758@gmail.com>
Tue, 6 Apr 2021 17:52:57 +0000 (12:52 -0500)
committerHarmon <Harmon758@gmail.com>
Tue, 6 Apr 2021 17:52:57 +0000 (12:52 -0500)
tweepy/api.py

index 4faa558ededc2d9b6f8cfda9df996e4bb5da3cf8..4ea4d7f0f9f5b9bd4cad76a9beefd5aea459de70 100644 (file)
@@ -96,8 +96,8 @@ class API:
 
         if not isinstance(self.parser, Parser):
             raise TypeError(
-                '"parser" argument has to be an instance of "Parser". '
-                f'It is currently a {type(self.parser)}.'
+                "parser should be an instance of Parser, not " +
+                str(type(self.parser))
             )
 
         self.session = requests.Session()