This reverts commit <code>6c1a7a6</code>.
Showing 1 of 2 files from the diff.
wcmatch/glob.py
changed.
Other files ignored by Codecov
tox.ini
has changed.
@@ -618,9 +618,9 @@
Loading
618 | 618 | try: |
|
619 | 619 | fd = None # type: Optional[int] |
|
620 | 620 | if self.is_abs_pattern and curdir: |
|
621 | - | scandir = curdir # type: AnyStr |
|
621 | + | scandir = curdir # type: Union[AnyStr, int] |
|
622 | 622 | elif self.dir_fd is not None: |
|
623 | - | fd = os.open( |
|
623 | + | fd = scandir = os.open( |
|
624 | 624 | os.path.join(self.root_dir, curdir) if curdir else self.root_dir, |
|
625 | 625 | _wcmatch.DIR_FLAGS, |
|
626 | 626 | dir_fd=self.dir_fd |
@@ -633,36 +633,20 @@
Loading
633 | 633 | yield special, True, True, False |
|
634 | 634 | ||
635 | 635 | try: |
|
636 | - | if sys.version_info > (3, 6): |
|
637 | - | with os.scandir(cast(Union[AnyStr, int], fd if fd is not None else scandir)) as scan: |
|
638 | - | for f in scan: |
|
639 | - | try: |
|
640 | - | hidden = self._is_hidden(f.name) # type: ignore[arg-type] |
|
641 | - | is_dir = f.is_dir() |
|
642 | - | if is_dir: |
|
643 | - | is_link = f.is_symlink() |
|
644 | - | else: |
|
645 | - | # We don't care if a file is a link |
|
646 | - | is_link = False |
|
647 | - | if (not dir_only or is_dir): |
|
648 | - | yield f.name, is_dir, hidden, is_link # type: ignore[misc] |
|
649 | - | except OSError: # pragma: no cover |
|
650 | - | pass |
|
651 | - | else: |
|
652 | - | with os.scandir(scandir) as scan: |
|
653 | - | for f in scan: |
|
654 | - | try: |
|
655 | - | hidden = self._is_hidden(f.name) |
|
656 | - | is_dir = f.is_dir() |
|
657 | - | if is_dir: |
|
658 | - | is_link = f.is_symlink() |
|
659 | - | else: |
|
660 | - | # We don't care if a file is a link |
|
661 | - | is_link = False |
|
662 | - | if (not dir_only or is_dir): |
|
663 | - | yield f.name, is_dir, hidden, is_link |
|
664 | - | except OSError: # pragma: no cover |
|
665 | - | pass |
|
636 | + | with os.scandir(scandir) as scan: # type: ignore[type-var] |
|
637 | + | for f in scan: |
|
638 | + | try: |
|
639 | + | hidden = self._is_hidden(f.name) # type: ignore[arg-type] |
|
640 | + | is_dir = f.is_dir() |
|
641 | + | if is_dir: |
|
642 | + | is_link = f.is_symlink() |
|
643 | + | else: |
|
644 | + | # We don't care if a file is a link |
|
645 | + | is_link = False |
|
646 | + | if (not dir_only or is_dir): |
|
647 | + | yield f.name, is_dir, hidden, is_link # type: ignore[misc] |
|
648 | + | except OSError: # pragma: no cover |
|
649 | + | pass |
|
666 | 650 | finally: |
|
667 | 651 | if fd is not None: |
|
668 | 652 | os.close(fd) |
Files | Coverage |
---|---|
wcmatch | 100.00% |
Project Totals (10 files) | 100.00% |
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.