Beispiel #1
0
 def _close(self):
     notify_close(self._fileno)
     self._mark_as_closed()
     try:
         os.close(self._fileno)
     except:
         # os.close may fail if __init__ didn't complete
         # (i.e file dscriptor passed to popen was invalid
         pass
Beispiel #2
0
 def _close(self):
     notify_close(self._fileno)
     self._mark_as_closed()
     try:
         os.close(self._fileno)
     except:
         # os.close may fail if __init__ didn't complete
         # (i.e file dscriptor passed to popen was invalid
         pass
Beispiel #3
0
 def close(self):
     if not self._closed:
         self._closed = True
         _original_os.close(self._fileno)
     notify_close(self._fileno)
     for method in [
             'fileno', 'flush', 'isatty', 'next', 'read', 'readinto',
             'readline', 'readlines', 'seek', 'tell', 'truncate',
             'write', 'xreadlines', '__iter__', '__next__', 'writelines']:
         setattr(self, method, _operation_on_closed_file)
Beispiel #4
0
 def close(self):
     if not self._closed:
         _original_os.close(self._fileno)
         self._closed = True
     notify_close(self._fileno)
     for method in [
             'fileno', 'flush', 'isatty', 'next', 'read', 'readinto',
             'readline', 'readlines', 'seek', 'tell', 'truncate',
             'write', 'xreadlines', '__iter__', '__next__', 'writelines']:
         setattr(self, method, _operation_on_closed_file)
Beispiel #5
0
 def _close(self):
     was_closed = self._mark_as_closed()
     if was_closed:
         return
     if notify_close:
         # If closing from __del__, notify_close may have
         # already been cleaned up and set to None
         notify_close(self._fileno)
     try:
         os.close(self._fileno)
     except:
         # os.close may fail if __init__ didn't complete
         # (i.e file dscriptor passed to popen was invalid
         pass
Beispiel #6
0
 def close(self):
     if not self._closed:
         self._closed = True
         _original_os.close(self._fileno)
     notify_close(self._fileno)
     for method in [
         "fileno",
         "flush",
         "isatty",
         "next",
         "read",
         "readinto",
         "readline",
         "readlines",
         "seek",
         "tell",
         "truncate",
         "write",
         "xreadlines",
         "__iter__",
         "__next__",
         "writelines",
     ]:
         setattr(self, method, _operation_on_closed_file)
Beispiel #7
0
 def close(self):
     notify_close(self.fd)
     self._mark_as_closed()
     return self.fd.close()
Beispiel #8
0
 def close(self):
     notify_close(self.fd)
     self._mark_as_closed()   # Don't do this twice.
     return self.fd.close()
Beispiel #9
0
 def close(self):
     notify_close(self.fd)
     self._mark_as_closed()
     return self.fd.close()
Beispiel #10
0
 def _mark_as_closed(self):
     """ Mark this socket as being closed """
     self._closed = True
     notify_close(self.fileno)
Beispiel #11
0
 def close(self):
     notify_close(self._fd)
     try:
         os.close(self._fd)
     except:
         pass