One function
PyenvProvider in frostming/findpython
The author described this change as “fix: prevent find_all exception when a clean pyenv is present (#11)”. It counts as a record because the check below fails on the code as it stood at 6179b9a3d and passes on 2ce66fa6c, with nothing else changed between the two runs.
Projectfrostming/findpython
Fix saved2022-10-28
Sharing licenceMIT · LICENSE
Change size+8 −6
What the code was meant to do, written into the code itself as a docstring
A provider that finds python installed with pyenv
The change
| 14 | 14 | return cls(Path(pyenv_root)) | |
| 15 | 15 | ||
| 16 | 16 | def find_pythons(self) -> Iterable[PythonVersion]: | |
| 17 | - | for version in self.root.joinpath("versions").iterdir(): | |
| 18 | - | if version.is_dir(): | |
| 19 | - | bindir = version / "bin" | |
| 20 | - | if not bindir.exists(): | |
| 21 | - | bindir = version | |
| 22 | - | yield from self.find_pythons_from_path(bindir, True) | |
| 17 | + | versions_path = self.root.joinpath("versions") | |
| 18 | + | if versions_path.exists(): | |
| 19 | + | for version in versions_path.iterdir(): | |
| 20 | + | if version.is_dir(): | |
| 21 | + | bindir = version / "bin" | |
| 22 | + | if not bindir.exists(): | |
| 23 | + | bindir = version | |
| 24 | + | yield from self.find_pythons_from_path(bindir, True) |
The check that tells the two apart
fail→pass·tests/test_finder.py::test_find_python_skips_empty_pyenv
Check file tests/test_finder.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it6179b9a3df0bbaff5a14bc8363b89a2c12d96c81
Broken version dated2022-08-09
Modulefindpython.providers.pyenv
Units changedPyenvProvider
Fingerprintffb20e8803cc8268
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.