Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: crash when building inside a submodule (#854)
If .git is a file instead of a directory (such as when you are building in a submodule), scikit-build-core will currently crash because a NotADirectoryError is thrown instead of a FileNotFoundError. This PR accounts for the resulting exception (NotADirectoryError) instead of crashing. Another option instead of hardcoding this list would be to catch the more general `OSError`. However, I did not do that, because I am worried about silently swallowing too broad of a class of exceptions. I wrote a unit test and also tested the fix [against the project][1] where I encountered this. [1]: https://github.com/scikit-build/scikit-build-core/blob/main/.github/CONTRIBUTING.md#testing-a-project-with-a-branch--main (By the way, this project is very helpful, thank you. The fact that I encountered this issue only a couple of hours after the release of 0.10.0 tells you how often I use it!)
- Loading branch information