def __init__(self, fobj, mode='rb', bufsize=-1, close=True): if isinstance(fobj, (int, long)): fileno = fobj fobj = None else: fileno = fobj.fileno() sock = SocketAdapter(fileno, mode, close=close) self._fobj = fobj self._closed = False _fileobject.__init__(self, sock, mode=mode, bufsize=bufsize, close=close)
def __init__(self, fobj, mode='rb', bufsize=-1, close=True): if isinstance(fobj, integer_types): fileno = fobj fobj = None else: fileno = fobj.fileno() sock = SocketAdapter(fileno, mode, close=close) self._fobj = fobj self._closed = False _fileobject.__init__(self, sock, mode=mode, bufsize=bufsize, close=close)
def __init__(self, fobj, mode='rb', bufsize=-1, close=True): if isinstance(fobj, integer_types): fileno = fobj fobj = None else: fileno = fobj.fileno() sock = SocketAdapter(fileno, mode, close=close) self._fobj = fobj self._closed = False _fileobject.__init__(self, sock, mode=mode, bufsize=bufsize, close=close) if PYPY: sock._drop()