From 26dc2e9944c1c949c2f6e65522c34e4dae7195b2 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 23 Aug 2025 16:45:50 +0300 Subject: [PATCH 1/3] Fix unused imports for android --- vm/src/stdlib/pwd.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vm/src/stdlib/pwd.rs b/vm/src/stdlib/pwd.rs index 482c297cc53..1cd6896e63b 100644 --- a/vm/src/stdlib/pwd.rs +++ b/vm/src/stdlib/pwd.rs @@ -5,14 +5,16 @@ pub(crate) use pwd::make_module; #[pymodule] mod pwd { use crate::{ - PyObjectRef, PyResult, VirtualMachine, + PyResult, VirtualMachine, builtins::{PyIntRef, PyUtf8StrRef}, - convert::{IntoPyException, ToPyObject}, + convert::IntoPyException, exceptions, types::PyStructSequence, }; use nix::unistd::{self, User}; - use std::ptr::NonNull; + + #[cfg(not(target_os = "android"))] + use crate::{PyObjectRef, convert::ToPyObject}; #[pyattr] #[pyclass(module = "pwd", name = "struct_passwd")] @@ -101,7 +103,7 @@ mod pwd { let mut list = Vec::new(); unsafe { libc::setpwent() }; - while let Some(ptr) = NonNull::new(unsafe { libc::getpwent() }) { + while let Some(ptr) = str::ptr::NonNull::new(unsafe { libc::getpwent() }) { let user = User::from(unsafe { ptr.as_ref() }); let passwd = Passwd::from(user).to_pyobject(vm); list.push(passwd); From 9bf6cc37de80312401dd83e0fbe429ba9aeb462b Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 23 Aug 2025 16:48:18 +0300 Subject: [PATCH 2/3] fix typo --- vm/src/stdlib/pwd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/src/stdlib/pwd.rs b/vm/src/stdlib/pwd.rs index 1cd6896e63b..525b957e56d 100644 --- a/vm/src/stdlib/pwd.rs +++ b/vm/src/stdlib/pwd.rs @@ -103,7 +103,7 @@ mod pwd { let mut list = Vec::new(); unsafe { libc::setpwent() }; - while let Some(ptr) = str::ptr::NonNull::new(unsafe { libc::getpwent() }) { + while let Some(ptr) = std::ptr::NonNull::new(unsafe { libc::getpwent() }) { let user = User::from(unsafe { ptr.as_ref() }); let passwd = Passwd::from(user).to_pyobject(vm); list.push(passwd); From c3a6cb65b0c84abe7a4850f049f48ce1a0fc2775 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 23 Aug 2025 18:32:22 +0300 Subject: [PATCH 3/3] Trigger CI