Skip to content

Commit 26dc2e9

Browse files
committed
Fix unused imports for android
1 parent e3e0e8a commit 26dc2e9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

vm/src/stdlib/pwd.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ pub(crate) use pwd::make_module;
55
#[pymodule]
66
mod 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) = str::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);

0 commit comments

Comments
 (0)