lsof_check: include exc with skip message

This commit is contained in:
Daniel Hahler 2019-10-29 15:18:29 +01:00
parent 0225cb37c0
commit 8c21416798
1 changed files with 2 additions and 2 deletions

View File

@ -905,9 +905,9 @@ def lsof_check():
pid = os.getpid()
try:
out = subprocess.check_output(("lsof", "-p", str(pid))).decode()
except (OSError, subprocess.CalledProcessError, UnicodeDecodeError):
except (OSError, subprocess.CalledProcessError, UnicodeDecodeError) as exc:
# about UnicodeDecodeError, see note on pytester
pytest.skip("could not run 'lsof'")
pytest.skip("could not run 'lsof' ({!r})".format(exc))
yield
out2 = subprocess.check_output(("lsof", "-p", str(pid))).decode()
len1 = len([x for x in out.split("\n") if "REG" in x])