forked from jan/mem_edit
get_path should return None on failure
This commit is contained in:
parent
e56ec88761
commit
f7c7496cfd
@ -78,12 +78,12 @@ class Process(AbstractProcess):
|
|||||||
mem.readinto(read_buffer)
|
mem.readinto(read_buffer)
|
||||||
return read_buffer
|
return read_buffer
|
||||||
|
|
||||||
def get_path(self) -> str:
|
def get_path(self) -> str | None:
|
||||||
try:
|
try:
|
||||||
with open('/proc/{}/cmdline', 'rb') as f:
|
with open(f'/proc/{self.pid}/cmdline', 'rb') as ff:
|
||||||
return f.read().decode().split('\x00')[0]
|
return ff.read().decode().split('\x00')[0]
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
return ''
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def list_available_pids() -> list[int]:
|
def list_available_pids() -> list[int]:
|
||||||
|
Loading…
Reference in New Issue
Block a user