Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Jan 3, 2025
1 parent 82680a0 commit 9f3ce69
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mitmproxy-rs/src/process_info.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::path::{Path, PathBuf};

use anyhow::Result;
use anyhow::Context;

Check warning on line 3 in mitmproxy-rs/src/process_info.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, nightly, --package mitmproxy-linux-ebpf)

unused import: `anyhow::Context`

Check warning on line 3 in mitmproxy-rs/src/process_info.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, stable, --exclude mitmproxy-linux-ebpf)

unused import: `anyhow::Context`

Check warning on line 3 in mitmproxy-rs/src/process_info.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, stable, --exclude mitmproxy-linux-ebpf)

unused import: `anyhow::Context`

Check warning on line 3 in mitmproxy-rs/src/process_info.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-22.04, 1.80, --exclude mitmproxy-linux-ebpf)

unused import: `anyhow::Context`

Check warning on line 3 in mitmproxy-rs/src/process_info.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-22.04, 1.80, --exclude mitmproxy-linux-ebpf)

unused import: `anyhow::Context`
use pyo3::prelude::*;
use pyo3::IntoPyObjectExt;

Check warning on line 5 in mitmproxy-rs/src/process_info.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, nightly, --package mitmproxy-linux-ebpf)

unused import: `pyo3::IntoPyObjectExt`

Check warning on line 5 in mitmproxy-rs/src/process_info.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, stable, --exclude mitmproxy-linux-ebpf)

unused import: `pyo3::IntoPyObjectExt`

Check warning on line 5 in mitmproxy-rs/src/process_info.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, stable, --exclude mitmproxy-linux-ebpf)

unused import: `pyo3::IntoPyObjectExt`

Check warning on line 5 in mitmproxy-rs/src/process_info.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-22.04, 1.80, --exclude mitmproxy-linux-ebpf)

unused import: `pyo3::IntoPyObjectExt`

Check warning on line 5 in mitmproxy-rs/src/process_info.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-22.04, 1.80, --exclude mitmproxy-linux-ebpf)

unused import: `pyo3::IntoPyObjectExt`

Expand Down Expand Up @@ -68,11 +68,14 @@ pub fn active_executables() -> PyResult<Vec<Process>> {
/// *Availability: Windows, macOS*
#[pyfunction]
#[allow(unused_variables)]
pub fn executable_icon(path: PathBuf) -> Result<PyObject> {
pub fn executable_icon(py: Python<'_>, path: PathBuf) -> PyResult<PyObject> {
#[cfg(any(windows, target_os = "macos"))]
{
let mut icon_cache = processes::ICON_CACHE.lock().unwrap();
Ok(icon_cache.get_png(path)?)
icon_cache
.get_png(path)
.context("failed to get image")?
.into_py_any(py)
}
#[cfg(not(any(windows, target_os = "macos")))]
Err(pyo3::exceptions::PyNotImplementedError::new_err(
Expand Down

0 comments on commit 9f3ce69

Please sign in to comment.