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".
This commit is contained in:
Eli Schwartz 2022-09-22 15:00:41 -04:00
parent 389b2f6785
commit 29ac7dd088
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
1 changed files with 2 additions and 6 deletions

View File

@ -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'