Skip to content

Commit

Permalink
pyflakes
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Nov 28, 2016
1 parent d1098ac commit fea6904
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ def main(argv):
senf.print_("%6d %13s %s%s%s" % (size, mtime_format, color,
entry, reset))


if __name__ == "__main__":
main(senf.argv)
7 changes: 4 additions & 3 deletions senf/_fsnative.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def _get_encoding():
return "ascii"
return encoding


_encoding = _get_encoding()


Expand All @@ -201,10 +202,10 @@ def path2fsn(path):
# allow mbcs str on py2+win and bytes on py3
if PY2:
if is_win:
if isinstance(path, str):
if isinstance(path, bytes):
path = path.decode(_encoding)
else:
if isinstance(path, unicode):
if isinstance(path, text_type):
path = path.encode(_encoding)
else:
path = getattr(os, "fspath", lambda x: x)(path)
Expand Down Expand Up @@ -343,7 +344,7 @@ def uri2fsn(uri):
"""

if PY2:
if isinstance(uri, unicode):
if isinstance(uri, text_type):
uri = uri.encode("utf-8")
if not isinstance(uri, bytes):
raise TypeError("uri needs to be ascii str or unicode")
Expand Down
1 change: 1 addition & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def notfsnative(text=u""):
else:
return fsn2bytes(fsn, "utf-8")


assert not isinstance(notfsnative(), fsnative)


Expand Down

0 comments on commit fea6904

Please sign in to comment.