Avoid TOCTOU errors in .python-version reads (#5223)
## Summary Not a big deal, but better to try the operation and handle the failure case than to check if the file exists and _then_ read it.
This commit is contained in:
@@ -14,8 +14,8 @@ pub use crate::prefix::Prefix;
|
||||
pub use crate::python_version::PythonVersion;
|
||||
pub use crate::target::Target;
|
||||
pub use crate::version_files::{
|
||||
request_from_version_file, requests_from_version_file, version_file_exists,
|
||||
versions_file_exists, PYTHON_VERSIONS_FILENAME, PYTHON_VERSION_FILENAME,
|
||||
request_from_version_file, requests_from_version_file, PYTHON_VERSIONS_FILENAME,
|
||||
PYTHON_VERSION_FILENAME,
|
||||
};
|
||||
pub use crate::virtualenv::{Error as VirtualEnvError, PyVenvConfiguration, VirtualEnvironment};
|
||||
mod discovery;
|
||||
|
||||
Reference in New Issue
Block a user