8000 Fix OSError message · RustPython/RustPython@7cd5088 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7cd5088

Browse files
committed
Fix OSError message
1 parent c9c07a6 commit 7cd5088

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vm/src/exceptions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,14 +1307,14 @@ pub(super) mod types {
13071307

13081308
let s = match obj.get_attr("filename", vm) {
13091309
Ok(filename) => match obj.get_attr("filename2", vm) {
1310-
Ok(filename2) => format!(
1310+
Ok(filename2) if !vm.is_none(&filename2) => format!(
13111311
"[Errno {}] {}: '{}' -> '{}'",
13121312
errno,
13131313
msg,
13141314
filename.str(vm)?,
13151315
filename2.str(vm)?
13161316
),
1317-
Err(_) => format!("[Errno {}] {}: '{}'", errno, msg, filename.str(vm)?),
1317+
_ => format!("[Errno {}] {}: '{}'", errno, msg, filename.str(vm)?),
13181318
},
13191319
Err(_) => {
13201320
format!("[Errno {errno}] {msg}")

0 commit comments

Comments
 (0)
0