예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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()