forked from jan/mem_edit
Style fixes
This commit is contained in:
parent
e962137950
commit
b50b37c1c4
5 changed files with 22 additions and 22 deletions
|
|
@ -43,10 +43,10 @@ def ptrace(command: int, pid: int = 0, arg1: int = 0, arg2: int = 0) -> int:
|
|||
logger.debug('ptrace({}, {}, {}, {})'.format(command, pid, arg1, arg2))
|
||||
result = _ptrace(command, pid, arg1, arg2)
|
||||
if result == -1:
|
||||
errno = ctypes.get_errno()
|
||||
if errno:
|
||||
err_no = ctypes.get_errno()
|
||||
if err_no:
|
||||
raise MemEditError('ptrace({}, {}, {}, {})'.format(command, pid, arg1, arg2) +
|
||||
' failed with error {}: {}'.format(errno, strerror(errno)))
|
||||
' failed with error {}: {}'.format(err_no, strerror(err_no)))
|
||||
return result
|
||||
|
||||
|
||||
|
|
@ -75,8 +75,8 @@ class Process(AbstractProcess):
|
|||
|
||||
def get_path(self) -> str:
|
||||
try:
|
||||
with open('/proc/{}/cmdline', 'rb') as f:
|
||||
return f.read().decode().split('\x00')[0]
|
||||
with open('/proc/{}/cmdline', 'rb') as f:
|
||||
return f.read().decode().split('\x00')[0]
|
||||
except FileNotFoundError:
|
||||
return ''
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue