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

Unified Diff: abp/filters/rpy.py

Issue 29992563: Noissue - Work around N812 and E117 from flake8 update (Closed) Base URL: https://hg.adblockplus.org/python-abp
Patch Set: Ignore errors instead of working around the linter, avoid E117 Created Jan. 30, 2019, 10:41 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
« no previous file with comments | « no previous file | tests/test_render_script.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: abp/filters/rpy.py
===================================================================
--- a/abp/filters/rpy.py
+++ b/abp/filters/rpy.py
@@ -61,18 +61,18 @@
"""
if isinstance(data, dict):
return {strings2utf8(k): strings2utf8(v) for k, v in data.items()}
if isinstance(data, list):
return [strings2utf8(v) for v in data]
if isinstance(data, tuple):
return tuple(strings2utf8(v) for v in data)
- if isinstance(data, type('')): # Python 2/3 compatible way of
- # saying "unicode string".
+ if isinstance(data, type('')):
+ # The condition is a Python 2/3 way of saying "unicode string".
Vasily Kuznetsov 2019/01/30 10:42:48 Reformatted this to avoid E117.
return data.encode('utf-8')
return data
def line2dict(text, mode='body'):
"""Convert a filterlist line to a dictionary.
All strings in the output dictionary will be UTF8 byte strings. This is
« no previous file with comments | « no previous file | tests/test_render_script.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld