Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions plugins/murmuration/rust/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ pub(crate) enum Os {
pub(crate) const OS: Os = if cfg!(windows) { Os::Windows } else { Os::Unix };

/// The interpreter the Python fallback is spawned with.
///
/// `python3` on Windows too: the Python rows of `hooks.json` (SessionStart's install among them) start `python3`, so a
/// machine the plugin runs on has one, while `python` may be missing or only the Microsoft Store stub.
pub(crate) fn python_for(os: Os) -> &'static str {
match os {
Os::Unix => "python3",
Os::Windows => "python",
Os::Unix | Os::Windows => "python3",
}
}

Expand Down Expand Up @@ -101,7 +103,7 @@ mod tests {
#[test]
fn python_names() {
assert_eq!(python_for(Os::Unix), "python3");
assert_eq!(python_for(Os::Windows), "python");
assert_eq!(python_for(Os::Windows), "python3");
}

#[test]
Expand Down
Loading