File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ pub fn os_open(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
132132fn _set_file_model ( flags : & PyObjectRef ) -> OpenOptions {
133133 let flags = objint:: get_value ( flags) . to_i32 ( ) . unwrap ( ) ;
134134 let mut options = OpenOptions :: new ( ) ;
135- options. read ( flags & libc:: O_RDONLY != 0 ) ;
135+ options. read ( flags == libc:: O_RDONLY ) ;
136136 options. write ( flags & libc:: O_WRONLY != 0 ) ;
137137 options. append ( flags & libc:: O_APPEND != 0 ) ;
138138 options. custom_flags ( flags) ;
@@ -143,7 +143,7 @@ fn _set_file_model(flags: &PyObjectRef) -> OpenOptions {
143143fn _set_file_model ( flags : & PyObjectRef ) -> OpenOptions {
144144 let flags = objint:: get_value ( flags) . to_u32 ( ) . unwrap ( ) ;
145145 let mut options = OpenOptions :: new ( ) ;
146- options. read ( ( flags as i32 ) & libc :: O_RDONLY ! = libc:: O_RDONLY ) ;
146+ options. read ( ( flags as i32 ) = = libc:: O_RDONLY ) ;
147147 options. write ( ( flags as i32 ) & libc:: O_WRONLY != 0 ) ;
148148 options. append ( ( flags as i32 ) & libc:: O_APPEND != 0 ) ;
149149 options. custom_flags ( flags) ;
You can’t perform that action at this time.
0 commit comments