Skip to content

Commit

Permalink
Suppress error when /proc/cpuinfo cannot be read
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker committed Nov 2, 2023
1 parent e60a516 commit 7d48ce7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pwnlib/tubes/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from pwnlib import term
from pwnlib.context import context, LocalContext
from pwnlib.exception import PwnlibException
from pwnlib.log import Logger
from pwnlib.log import getLogger
from pwnlib.term import text
Expand Down Expand Up @@ -2150,7 +2151,10 @@ def preexec():
def _cpuinfo(self):
if self._cpuinfo_cache is None:
with context.quiet:
self._cpuinfo_cache = self.read('/proc/cpuinfo')
try:
self._cpuinfo_cache = self.read('/proc/cpuinfo')
except PwnlibException:
self._cpuinfo_cache = b''
return self._cpuinfo_cache

@property
Expand Down

0 comments on commit 7d48ce7

Please sign in to comment.