meson icon indicating copy to clipboard operation
meson copied to clipboard

Prevent raw exception during project()

Open amcn opened this issue 1 year ago • 3 comments

If a user imports a module and invokes a method on it, a raw Python exception is raised to the user. This commit adds a check to ensure that in this case an appropriate exception is raised instead.

A test has been added to ensure that this exception is in fact raised on offending code.

Fixes #11393, #5134

amcn avatar Sep 07 '24 12:09 amcn

Yes. In Python, empty strings or empty containers evaluate to False. This is not the same as identity with the None singleton.

Overall, this looks good. Please squash your commits together.

bruchar1 avatar Sep 09 '24 14:09 bruchar1

See comments on the linked issue -- please tag #5134 as well.

eli-schwartz avatar Sep 09 '24 14:09 eli-schwartz

See comments on the linked issue -- please tag #5134 as well.

I've squashed together my commits and tagged #5134 in commit message. There's a failure in the Windows CI but it seems unrelated to this PR.

amcn avatar Sep 10 '24 07:09 amcn

I've squashed together my commits and tagged #5134 in commit message. There's a failure in the Windows CI but it seems unrelated to this PR.

Does not work for github purposes, each tagged issue must have its own copy of the word "Fixes" because github is github. Oh well, manually added the cross-linking this time so that the other ticket will get closed automatically.

eli-schwartz avatar Sep 15 '24 23:09 eli-schwartz

Does not work for github purposes, each tagged issue must have its own copy of the word "Fixes" because github is github. Oh well, manually added the cross-linking this time so that the other ticket will get closed automatically.

Apologies, I wasn't aware of this particular quirk of GitHub. I'll make sure to do it the proper way in the future.

Many thanks for the merge!

amcn avatar Sep 16 '24 07:09 amcn