After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787276 - Fix bogus or expressions
Fix bogus or expressions
Status: RESOLVED FIXED
Product: sysadmin
Classification: Infrastructure
Component: Git
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Sysadmins
GNOME Sysadmins
Depends on:
Blocks:
 
 
Reported: 2017-09-04 23:23 UTC by Giovanni Campagna
Modified: 2017-09-05 09:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix bogus or expressions (1.38 KB, patch)
2017-09-04 23:23 UTC, Giovanni Campagna
none Details | Review

Description Giovanni Campagna 2017-09-04 23:23:00 UTC
I found this while looking on commits-list. It seems there was some
confusion on Python syntax, but the code does not do what it's meant
to (or maybe it does it by chance).
Comment 1 Giovanni Campagna 2017-09-04 23:23:04 UTC
Created attachment 359127 [details] [review]
Fix bogus or expressions

The or expression would be evaluated first, and would evaluate
to the left hand side (which is truthy).
This is not what the code is meant to achieve. To do that, use
"in" to check membership in the tuple.
Comment 2 Andrea Veri 2017-09-05 09:10:40 UTC
Good catch Giovanni, you made me recall a string / integer always evaluates to true boolean speaking. I committed a slightly modified patch. [1] Thanks!

[1] https://git.gnome.org/browse/sysadmin-bin/commit/?id=51f8401