mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 11:16:24 +00:00
pyfec: argparse: simplify
This commit is contained in:
parent
7bc14c45ee
commit
c5c7605d54
@ -842,7 +842,8 @@ class FileType(object):
|
||||
"""
|
||||
def __init__(self, mode='r', bufsize=None):
|
||||
self._mode = mode
|
||||
self._bufsize = bufsize
|
||||
if self._bufsize is None:
|
||||
self._bufsize = -1
|
||||
|
||||
def __call__(self, string):
|
||||
# the special argument "-" means sys.std{in,out}
|
||||
@ -856,10 +857,7 @@ class FileType(object):
|
||||
raise ValueError(msg)
|
||||
|
||||
# all other arguments are used as file names
|
||||
if self._bufsize:
|
||||
return open(string, self._mode, self._bufsize)
|
||||
else:
|
||||
return open(string, self._mode)
|
||||
return open(string, self._mode, self._bufsize)
|
||||
|
||||
|
||||
# ===========================
|
||||
|
Loading…
Reference in New Issue
Block a user