Skip to content

Commit

Permalink
Fixed BaseNews class declaration.
Browse files Browse the repository at this point in the history
BaseNews was declared using python old-style type declaration without specifying its base class, object by default However this raises an exception on python 2.7, actually it was tested on 2.7.13:

File “~/.virtualenvs/test/lib/python2.7/site-packages/newsapi/sources.py", line 6, in __init__
    super(Sources, self).__init__(API_KEY)
TypeError: super() argument 1 must be type, not classobj

Please check https://www.python.org/doc/newstyle/ for reference.
  • Loading branch information
bethnull committed Mar 28, 2017
1 parent 492f99c commit 2704401
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion newsapi/base_news.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def __init__(self, *args, **kwargs):
self.__dict__ = self


class BaseNews:
class BaseNews(object):
def __init__(self, API_KEY):
self.API_KEY = API_KEY
self.payload = {"apiKey": self.API_KEY}
Expand Down

0 comments on commit 2704401

Please sign in to comment.