(self)
| 45 | self.open_dirfd() |
| 46 | |
| 47 | def open_dirfd(self): |
| 48 | if self.dir_fd is not None: |
| 49 | os.close(self.dir_fd) |
| 50 | if {os.open, os.stat} <= os.supports_dir_fd and os.scandir in os.supports_fd: |
| 51 | self.dir_fd = os.open(self.tempdir, os.O_RDONLY | os.O_DIRECTORY) |
| 52 | else: |
| 53 | self.dir_fd = None |
| 54 | |
| 55 | def tearDown(self): |
| 56 | if self.dir_fd is not None: |
no test coverage detected