File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -119,9 +119,8 @@ pub struct Socket {
119
119
}
120
120
121
121
impl PyValue for Socket {
122
- fn class ( _vm : & mut VirtualMachine ) -> PyObjectRef {
123
- // TODO
124
- unimplemented ! ( )
122
+ fn class ( vm : & mut VirtualMachine ) -> PyObjectRef {
123
+ vm. class ( "socket" , "socket" )
125
124
}
126
125
}
127
126
@@ -442,7 +441,7 @@ pub fn make_module(ctx: &PyContext) -> PyObjectRef {
442
441
py_module ! ( ctx, "socket" , {
443
442
"AF_INET" => ctx. new_int( AddressFamily :: Inet as i32 ) ,
444
443
"SOCK_STREAM" => ctx. new_int( SocketKind :: Stream as i32 ) ,
445
- "SOCK_DGRAM" => ctx. new_int( SocketKind :: Dgram as i32 ) ,
446
- "socket" => socket. clone( ) ,
444
+ "SOCK_DGRAM" => ctx. new_int( SocketKind :: Dgram as i32 ) ,
445
+ "socket" => socket. clone( ) ,
447
446
} )
448
447
}
Original file line number Diff line number Diff line change @@ -158,9 +158,8 @@ pub struct PyPromise {
158
158
}
159
159
160
160
impl PyValue for PyPromise {
161
- fn class ( _vm : & mut VirtualMachine ) -> PyObjectRef {
162
- // TODO
163
- unimplemented ! ( )
161
+ fn class ( vm : & mut VirtualMachine ) -> PyObjectRef {
162
+ vm. class ( "browser" , "Promise" )
164
163
}
165
164
}
166
165
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use rustpython_vm::{
11
11
use std:: cell:: RefCell ;
12
12
use std:: collections:: HashMap ;
13
13
use std:: rc:: { Rc , Weak } ;
14
- use wasm_bindgen:: { prelude:: * , JsCast } ;
14
+ use wasm_bindgen:: prelude:: * ;
15
15
16
16
pub trait HeldRcInner { }
17
17
You can’t perform that action at this time.
0 commit comments