8000 fix _ctypes error names · RustPython/RustPython@d05d600 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d05d600

Browse files
committed
fix _ctypes error names
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
1 parent b4f0a58 commit d05d600

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

vm/src/stdlib/ctypes.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,24 @@ pub(crate) mod _ctypes {
9090
#[pyattr]
9191
pub const DICTFLAG_FINAL: u32 = 0x1000;
9292

93-
#[pyattr(once)]
94-
fn error(vm: &VirtualMachine) -> PyTypeRef {
93+
#[pyattr(name = "ArgumentError", once)]
94+
fn argument_error(vm: &VirtualMachine) -> PyTypeRef {
9595
vm.ctx.new_exception_type(
9696
"_ctypes",
9797
"ArgumentError",
9898
Some(vec![vm.ctx.exceptions.exception_type.to_owned()]),
9999
)
100100
}
101101

102+
#[pyattr(name = "FormatError", once)]
103+
fn format_error(vm: &VirtualMachine) -> PyTypeRef {
104+
vm.ctx.new_exception_type(
105+
"_ctypes",
106+
"FormatError",
107+
Some(vec![vm.ctx.exceptions.exception_type.to_owned()]),
108+
)
109+
}
110+
102111
pub fn get_size(ty: &str) -> usize {
103112
match ty {
104113
"u" => mem::size_of::<WideChar>(),

0 commit comments

Comments
 (0)
0