Example #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()
Example #2
0
 def test_raises_EBADF(self):
     with ignore_errno('EBADF'):
         exc = OSError()
         exc.errno = errno.EBADF
         raise exc
Example #3
0
 def test_otherwise(self):
     with self.assertRaises(OSError):
         with ignore_errno('EBADF'):
             exc = OSError()
             exc.errno = errno.ENOENT
             raise exc
Example #4
0
 def body(self):
     self.on_init()
     with ignore_errno('EINTR', 'EAGAIN'):
         self._monitor.start()
Example #5
0
 def body(self):
     self.on_init()
     with ignore_errno("EINTR", "EAGAIN"):
         self._monitor.start()
Example #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)
Example #7
0
 def test_raises_EBADF(self):
     with ignore_errno('EBADF'):
         exc = OSError()
         exc.errno = errno.EBADF
         raise exc
Example #8
0
 def test_otherwise(self):
     with pytest.raises(OSError):
         with ignore_errno('EBADF'):
             exc = OSError()
             exc.errno = errno.ENOENT
             raise exc
Example #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()
Example #11
0
 def _remove_db(self):
     for suffix in self.known_suffixes:
         with platforms.ignore_errno(errno.ENOENT):
             os.remove(self.schedule_filename + suffix)