Skip to content

Commit

Permalink
Removed Python 3.4 support, updated aiohttp requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
reefab committed Apr 16, 2018
1 parent 7d0b09d commit 6940e17
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
17 changes: 7 additions & 10 deletions foobot_async/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,24 +154,21 @@ def _get(self, path, **kwargs):
with async_timeout.timeout(self._timeout):
resp = yield from self._session.get(
path, headers=dict(self._headers, **kwargs))
resp_text = yield from resp.text()
if resp.status == 400:
raise FoobotClient.BadFormat(resp.text())
raise FoobotClient.BadFormat(resp_text)
elif resp.status == 401:
raise FoobotClient.AuthFailure(resp.text())
raise FoobotClient.AuthFailure(resp_text)
elif resp.status == 403:
raise FoobotClient.ForbiddenAccess(resp.text())
raise FoobotClient.ForbiddenAccess(resp_text)
elif resp.status == 429:
raise FoobotClient.TooManyRequests(resp.text())
raise FoobotClient.TooManyRequests(resp_text)
elif resp.status == 500:
raise FoobotClient.InternalError(resp.text())
raise FoobotClient.InternalError(resp_text)
elif resp.status != 200:
raise FoobotClient.ClientError(resp.text())
raise FoobotClient.ClientError(resp_text)
return (yield from resp.json())

@property
def last_data_request(self):
return self._last_data_request

class ClientError(Exception):
"""Generic Error."""
pass
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setuptools.setup(
name="foobot_async",
version="0.3.0",
version="0.3.1",
url="https://github.com/reefab/foobot_async",

author="Fabien Piuzzi",
Expand All @@ -13,14 +13,13 @@

packages=setuptools.find_packages(),

install_requires=['aiohttp==2.3.10', 'async_timeout', 'typing>=3,<4'],
install_requires=['aiohttp>=2.3.10', 'async_timeout', 'typing>=3,<4'],
zip_safe=True,

classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist=py34,py35,py36
envlist=py35,py36

[testenv]
commands=py.test --cov=foobot_async
Expand Down

0 comments on commit 6940e17

Please sign in to comment.