diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-08-01 00:06:49 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-08-01 00:06:49 (GMT) |
commit | bdbddf8a82efd0e67f4006af91ce65bec2bf0a60 (patch) | |
tree | b57b0cb69a03af535aba7a0039bf659622725651 /Lib/os.py | |
parent | e19cadb427b6910930b50584bd9066ab5b198300 (diff) | |
download | cpython-bdbddf8a82efd0e67f4006af91ce65bec2bf0a60.zip cpython-bdbddf8a82efd0e67f4006af91ce65bec2bf0a60.tar.gz cpython-bdbddf8a82efd0e67f4006af91ce65bec2bf0a60.tar.bz2 |
#2491: os.fdopen() is now almost an alias to the builtin open(), and accepts the same parameters.
It just checks that the first argument is a file descriptor.
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -651,9 +651,9 @@ class _wrap_close: def __iter__(self): return iter(self._stream) -# Supply os.fdopen() (used by subprocess!) -def fdopen(fd, mode="r", buffering=-1): +# Supply os.fdopen() +def fdopen(fd, *args, **kwargs): if not isinstance(fd, int): raise TypeError("invalid fd type (%s, expected integer)" % type(fd)) import io - return io.open(fd, mode, buffering) + return io.open(fd, *args, **kwargs) |