From 29ac7dd0883454e6d5f26a0d666f13a9faf98238 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 22 Sep 2022 15:00:41 -0400 Subject: [PATCH] clean up message for OSError errorhandler Currently it repeats the text of the exception, which appeared immediately above. And strerror is already part of args, so that was then doubled. `str(e)` formats this much better anyway. While we are at it, point out that it is probably a build environment issue, rather than just saying "this is probably not a meson bug". The former comes across a bit more as constructive advice rather than just "idk but it's not our fault". --- mesonbuild/mesonmain.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index fed1e5696..2a55c03e9 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -52,12 +52,8 @@ def errorhandler(e, command): if command == 'runpython': return 2 elif isinstance(e, OSError): - error_msg = os.linesep.join([ - "Unhandled python exception", - f"{e.strerror} - {e.args}", - "this is probably not a Meson bug."]) - - mlog.exception(error_msg) + mlog.exception("Unhandled python OSError. This is probably not a Meson bug, " + "but an issue with your build environment.") return e.errno else: # Exception msg = 'Unhandled python exception'