diff --git a/src/modules/python.rs b/src/modules/python.rs index b871ef80..68d63673 100644 --- a/src/modules/python.rs +++ b/src/modules/python.rs @@ -58,7 +58,7 @@ fn python_module(mut module: Module, pyenv_version_name: bool, python_version: S let formatted_version = format_python_version(&python_version); module.new_segment("version", &formatted_version); get_python_virtual_env() - .map(|virtual_env| module.new_segment("virtualenv", &format!("({})", virtual_env))); + .map(|virtual_env| module.new_segment("virtualenv", &format!(" ({})", virtual_env))); }; module diff --git a/tests/testsuite/python.rs b/tests/testsuite/python.rs index 6dc972f6..d464fe91 100644 --- a/tests/testsuite/python.rs +++ b/tests/testsuite/python.rs @@ -120,7 +120,7 @@ fn with_virtual_env() -> io::Result<()> { .output()?; let actual = String::from_utf8(output.stdout).unwrap(); - let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.7.4(my_venv)")); + let expected = format!("via {} ", Color::Yellow.bold().paint("🐍 v3.7.4 (my_venv)")); assert_eq!(expected, actual); Ok(()) }