Mercurial > hgrepos > Python > libs > ConfigMix
diff configmix/compat.py @ 207:b3b5ed34d180
Handle most flake8 errors and warnings.
NOTE: E265 "block comment should start with '# ' ist not yet handled.
We would need to adjust our Python style.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 05 May 2019 18:29:47 +0200 |
| parents | b5ce9a8461bf |
| children | bbe8513ea649 |
line wrap: on
line diff
--- a/configmix/compat.py Sun May 05 16:53:13 2019 +0200 +++ b/configmix/compat.py Sun May 05 18:29:47 2019 +0200 @@ -9,11 +9,6 @@ from __future__ import division, absolute_import, print_function -import sys -import os -import locale - - __all__ = ["PY2", "text_to_native_os_str", "native_os_str_to_text", @@ -21,6 +16,11 @@ "u2fs"] +import sys +import os +import locale + + PY2 = sys.version_info[0] <= 2 @@ -32,7 +32,7 @@ def text_to_native_os_str(s, encoding=None): - if isinstance(s, unicode): + if isinstance(s, unicode): # noqa: F821 return s.encode(encoding or _OS_ENCODING) else: return s @@ -43,7 +43,7 @@ def u(s, encoding="utf-8"): - if isinstance(s, unicode): + if isinstance(s, unicode): # noqa: F821 return s else: return s.decode(encoding)
