Store absolute paths in PEP 723 scripts (#10161)

This commit is contained in:
Charlie Marsh 2024-12-25 15:23:39 -05:00 committed by GitHub
parent bec8468183
commit f40da39baf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ impl Pep723Script {
let metadata = Pep723Metadata::from_str(&metadata)?;
Ok(Some(Self {
path: file.as_ref().to_path_buf(),
path: std::path::absolute(file)?,
metadata,
prelude,
postlude,
@ -124,7 +124,7 @@ impl Pep723Script {
let (shebang, postlude) = extract_shebang(&contents)?;
Ok(Self {
path: file.as_ref().to_path_buf(),
path: std::path::absolute(file)?,
prelude: if shebang.is_empty() {
String::new()
} else {