Simplifies test if binary mode.
This commit is contained in:
parent
8ae339d870
commit
70e1169fe7
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user