(self)
| 279 | |
| 280 | @unittest.skipUnless(hasattr(fcntl, 'F_DUPFD'), 'need fcntl.F_DUPFD') |
| 281 | def test_bad_fd(self): |
| 282 | # gh-134744: Test error handling |
| 283 | fd = make_bad_fd() |
| 284 | with self.assertRaises(OSError): |
| 285 | fcntl.fcntl(fd, fcntl.F_DUPFD, 0) |
| 286 | with self.assertRaises(OSError): |
| 287 | fcntl.fcntl(fd, fcntl.F_DUPFD, b'\0' * 10) |
| 288 | with self.assertRaises(OSError): |
| 289 | fcntl.fcntl(fd, fcntl.F_DUPFD, b'\0' * 2048) |
| 290 | |
| 291 | |
| 292 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected