summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-08-01 00:06:49 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-08-01 00:06:49 (GMT)
commitbdbddf8a82efd0e67f4006af91ce65bec2bf0a60 (patch)
treeb57b0cb69a03af535aba7a0039bf659622725651 /Lib/os.py
parente19cadb427b6910930b50584bd9066ab5b198300 (diff)
downloadcpython-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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/os.py b/Lib/os.py
index a04aa7f..2fdf668 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -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)