Skip to content
Snippets Groups Projects
Commit 008f880a authored by Sybren A. Stüvel's avatar Sybren A. Stüvel
Browse files

Fixed incompatibility with attrs version 17.1+.

parent 9d83e427
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,11 @@ ...@@ -3,6 +3,11 @@
This file logs the changes that are actually interesting to users (new features, This file logs the changes that are actually interesting to users (new features,
changed functionality, fixed bugs). changed functionality, fixed bugs).
## Version 2.0.6 (in development)
- Fixed incompatibility with attrs version 17.1+.
## Version 2.0.5 (released 2017-05-09) ## Version 2.0.5 (released 2017-05-09)
- Vacuum SQLite database at startup. - Vacuum SQLite database at startup.
......
...@@ -36,9 +36,8 @@ class FlamencoManager: ...@@ -36,9 +36,8 @@ class FlamencoManager:
async def patch(self, *args, loop, **kwargs) -> requests.Response: async def patch(self, *args, loop, **kwargs) -> requests.Response:
return await self.client_request('PATCH', *args, loop=loop, **kwargs) return await self.client_request('PATCH', *args, loop=loop, **kwargs)
@functools.lru_cache(1) def __attrs_post_init__(self):
def user_agent(self): self.user_agent = 'Flamenco-Worker/%s' % self.flamenco_worker_version
return 'Flamenco-Worker/%s' % self.flamenco_worker_version
async def client_request(self, method, url, *, async def client_request(self, method, url, *,
params=None, params=None,
...@@ -83,7 +82,7 @@ class FlamencoManager: ...@@ -83,7 +82,7 @@ class FlamencoManager:
if headers is None: if headers is None:
headers = {} headers = {}
headers['User-Agent'] = self.user_agent() headers['User-Agent'] = self.user_agent
http_req = partial(self.session.request, http_req = partial(self.session.request,
method, abs_url, method, abs_url,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment