Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: abp/filters/sources.py

Issue 29933555: Noissue - fix coding style and adjust linting config (Closed) Base URL: https://hg.adblockplus.org/python-abp
Patch Set: Created Nov. 1, 2018, 11:21 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: abp/filters/sources.py
===================================================================
--- a/abp/filters/sources.py
+++ b/abp/filters/sources.py
@@ -164,18 +164,18 @@
"""
url = '{}:{}'.format(self.protocol, path_in_source)
try:
response = urlopen(url)
info = response.info()
# info.getparam became info.get_param in Python 3 so we'll
# try both.
- get_param = (getattr(info, 'get_param', None) or
- getattr(info, 'getparam', None))
+ get_param = (getattr(info, 'get_param', None)
+ or getattr(info, 'getparam', None))
encoding = get_param('charset') or self.default_encoding
for line in response:
yield line.decode(encoding).rstrip()
except HTTPError as err:
if err.code == 404:
raise NotFound("HTTP 404 Not found: '{}:{}'"
.format(self.protocol, path_in_source))
raise err
« no previous file with comments | « abp/filters/parser.py ('k') | tests/test_diff_script.py » ('j') | tests/test_diff_script.py » ('J')

Powered by Google App Engine
This is Rietveld