(self, path: str)
| 63 | self.fake_package_cache: set[str] = set() |
| 64 | |
| 65 | def stat_or_none(self, path: str) -> os.stat_result | None: |
| 66 | if path in self.stat_or_none_cache: |
| 67 | return self.stat_or_none_cache[path] |
| 68 | |
| 69 | st = None |
| 70 | try: |
| 71 | st = os.stat(path) |
| 72 | except OSError: |
| 73 | if self.init_under_package_root(path): |
| 74 | try: |
| 75 | st = self._fake_init(path) |
| 76 | except OSError: |
| 77 | pass |
| 78 | |
| 79 | self.stat_or_none_cache[path] = st |
| 80 | return st |
| 81 | |
| 82 | def init_under_package_root(self, path: str) -> bool: |
| 83 | """Is this path an __init__.py under a package root? |
no test coverage detected