File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,16 @@ pub(crate) use pwd::make_module;
55#[ pymodule]
66mod pwd {
77 use crate :: {
8- PyObjectRef , PyResult , VirtualMachine ,
8+ PyResult , VirtualMachine ,
99 builtins:: { PyIntRef , PyUtf8StrRef } ,
10- convert:: { IntoPyException , ToPyObject } ,
10+ convert:: IntoPyException ,
1111 exceptions,
1212 types:: PyStructSequence ,
1313 } ;
1414 use nix:: unistd:: { self , User } ;
15- use std:: ptr:: NonNull ;
15+
16+ #[ cfg( not( target_os = "android" ) ) ]
17+ use crate :: { PyObjectRef , convert:: ToPyObject } ;
1618
1719 #[ pyattr]
1820 #[ pyclass( module = "pwd" , name = "struct_passwd" ) ]
@@ -101,7 +103,7 @@ mod pwd {
101103 let mut list = Vec :: new ( ) ;
102104
103105 unsafe { libc:: setpwent ( ) } ;
104- while let Some ( ptr) = NonNull :: new ( unsafe { libc:: getpwent ( ) } ) {
106+ while let Some ( ptr) = std :: ptr :: NonNull :: new ( unsafe { libc:: getpwent ( ) } ) {
105107 let user = User :: from ( unsafe { ptr. as_ref ( ) } ) ;
106108 let passwd = Passwd :: from ( user) . to_pyobject ( vm) ;
107109 list. push ( passwd) ;
You can’t perform that action at this time.
0 commit comments