diff options
Diffstat (limited to 'Lib/io.py')
| -rw-r--r-- | Lib/io.py | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -177,7 +177,7 @@ class RawIOBase: raise IOError(".fileno() not supported") -class FileIO(RawIOBase): +class _PyFileIO(RawIOBase): """Raw I/O implementation for OS files.""" @@ -243,6 +243,18 @@ class FileIO(RawIOBase): return self._fd +try: + import _fileio +except ImportError: + # Let's use the Python version + FileIO = _PyFileIO +else: + # Create a trivial subclass with the proper inheritance structure + class FileIO(_fileio._FileIO, RawIOBase): + """Raw I/O implementation for OS files.""" + # XXX More docs + + class SocketIO(RawIOBase): """Raw I/O implementation for stream sockets.""" |
