Simplifies test if binary mode.

This commit is contained in:
Olivier Mangin 2017-04-14 19:04:48 -04:00
parent 8ae339d870
commit 70e1169fe7

View File

@ -50,10 +50,10 @@ def system_path(path):
def _open(path, mode):
if mode.find('b') == -1:
return open(system_path(path), mode, encoding='utf-8')
else:
return open(system_path(path), mode)
if 'b' in mode:
return open(system_path(path), mode, encoding='utf-8')
else:
return open(system_path(path), mode)
def check_file(path, fail=True):