(stack, match_pos)
| 493 | yield from select_recursive_step(stack, match_pos) |
| 494 | |
| 495 | def select_recursive_step(stack, match_pos): |
| 496 | path = stack.pop() |
| 497 | try: |
| 498 | entries = self.scandir(path) |
| 499 | except OSError: |
| 500 | pass |
| 501 | else: |
| 502 | for entry, _entry_name, entry_path in entries: |
| 503 | is_dir = False |
| 504 | try: |
| 505 | if entry.is_dir(follow_symlinks=follow_symlinks): |
| 506 | is_dir = True |
| 507 | except OSError: |
| 508 | pass |
| 509 | |
| 510 | if is_dir or not dir_only: |
| 511 | entry_path_str = self.stringify_path(entry_path) |
| 512 | if dir_only: |
| 513 | entry_path = self.concat_path(entry_path, self.sep) |
| 514 | if match is None or match(entry_path_str, match_pos): |
| 515 | if dir_only: |
| 516 | yield from select_next(entry_path, exists=True) |
| 517 | else: |
| 518 | # Optimization: directly yield the path if this is |
| 519 | # last pattern part. |
| 520 | yield entry_path |
| 521 | if is_dir: |
| 522 | stack.append(entry_path) |
| 523 | |
| 524 | return select_recursive |
| 525 |
nothing calls this directly
no test coverage detected