-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Change OSError and its subclasses attributes #2993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Related: #2974. Haven't been paying much attention to it but you might want to see the updates there since they should affect how this PR should try and implement this. |
832ffad
to
322057e
Compare
cae22df
to
4792bab
Compare
4792bab
to
bbf87c7
Compare
vm/src/exceptions.rs
Outdated
@@ -949,6 +949,7 @@ pub(super) mod types { | |||
use crate::{ | |||
builtins::{traceback::PyTracebackRef, PyInt, PyTupleRef, PyTypeRef}, | |||
function::{FuncArgs, IntoPyResult}, | |||
pyobject::{PyValue, TypeProtocol}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyobject::{PyValue, TypeProtocol}, | |
PyValue, TypeProtocol, |
0a75d79
to
e84bcb6
Compare
@deantvv could you review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks great and makes OSError behaves more like CPython version.
vm/src/exceptions.rs
Outdated
} | ||
|
||
fn os_error_parse_args( | ||
exc_self: PyBaseExceptionRef, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exc_self: PyBaseExceptionRef, | |
exc_self: &PyBaseExceptionRef, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use the reference to remove some clone
.
86e6443
to
8158379
Compare
3f534a4
to
72bc663
Compare
72bc663
to
6138130
Compare
6138130
to
ee9f041
Compare
ee9f041
to
cd32e67
Compare
1c6547e
to
48b6860
Compare
9b4598c
to
9617789
Compare
Make errno, strerror of OSError from readonly to attributes Add OSError's attributes even they are None
9617789
to
db53fd2
Compare
Too old to fix the codes. I close this PR and will check other issues. |
This PR provides specified attribute "characters_written" to BlockingIOError. Other unnecessary attributes are ignored in BlockingIOError such as winerror, filename, filename2.