Esempio n. 1
0
 def close(self, poller):
     for f, fd in self.filemap.iteritems():
         if fd is not None:
             poller.unregister(fd)
             with ignore_errno('EBADF'):  # pragma: no cover
                 os.close(fd)
     self.filemap.clear()
     self.fdmap.clear()
Esempio n. 2
0
 def test_raises_EBADF(self):
     with ignore_errno('EBADF'):
         exc = OSError()
         exc.errno = errno.EBADF
         raise exc
Esempio n. 3
0
 def test_otherwise(self):
     with self.assertRaises(OSError):
         with ignore_errno('EBADF'):
             exc = OSError()
             exc.errno = errno.ENOENT
             raise exc
Esempio n. 4
0
 def body(self):
     self.on_init()
     with ignore_errno('EINTR', 'EAGAIN'):
         self._monitor.start()
Esempio n. 5
0
 def body(self):
     self.on_init()
     with ignore_errno("EINTR", "EAGAIN"):
         self._monitor.start()
Esempio n. 6
0
 def set_trace(self, frame=None):
     if frame is None:
         frame = _frame().f_back
     with ignore_errno(errno.ECONNRESET):
         Pdb.set_trace(self, frame)
Esempio n. 7
0
 def test_raises_EBADF(self):
     with ignore_errno('EBADF'):
         exc = OSError()
         exc.errno = errno.EBADF
         raise exc
Esempio n. 8
0
 def test_otherwise(self):
     with pytest.raises(OSError):
         with ignore_errno('EBADF'):
             exc = OSError()
             exc.errno = errno.ENOENT
             raise exc
Esempio n. 9
0
 def set_trace(self, frame=None):
     if frame is None:
         frame = _frame().f_back
     with ignore_errno(errno.ECONNRESET):
         Pdb.set_trace(self, frame)
 def body(self):
     self.on_init()
     with ignore_errno('EINTR', 'EAGAIN'):
         self._monitor.start()
Esempio n. 11
0
 def _remove_db(self):
     for suffix in self.known_suffixes:
         with platforms.ignore_errno(errno.ENOENT):
             os.remove(self.schedule_filename + suffix)