Univention Bugzilla – Bug 22487
Vergleich auf None
Last modified: 2012-12-12 21:09:32 CET
Vergleiche auf None sollten mit "is None" oder "is not None" passieren, nicht aber per "== None", "!= None" oder "<> None", da dies bei Objekten dazu führt, das dort __eq__() bzw. __cmp__() aufgerufen wird, was ggf. zu Fehlern führt. re.compile(r"""\b(?:if|while)\b.*(?:(?:!=|<>|==)\s*None\b|\bNone\s*(?:!=|<>|==)).*:""")
Umgesetzt in 0009-Python. svn34344, ucslint_3.0.0-1
Funktioniert. ============================================================================ S:0009-7: univention-s4-connector/modules/univention/s4connector/__init__.py:1638:6: fragile comparison with None S:0009-7: univention-s4-connector/modules/univention/s4connector/__init__.py:1654:5: fragile comparison with None S:0009-7: univention-s4-connector/modules/univention/s4connector/__init__.py:1683:7: fragile comparison with None S:0009-7: univention-s4-connector/modules/univention/s4connector/s4/password.py:512:4: fragile comparison with None S:0009-7: univention-s4-connector/modules/univention/s4connector/s4/password.py:526:3: fragile comparison with None S:0009-7: univention-s4-connector/modules/univention/s4connector/s4/dns.py:709:4: fragile comparison with None ============================================================================ Changelogeintrag fehlt noch -> Reopened.
ChangeLog: svn22487 \item \ucsName{ucslint} warns about fragile comparisons with None in Python code (\ucsBug{22487}).
(In reply to comment #3) > ChangeLog: svn22487 > \item \ucsName{ucslint} warns about fragile comparisons with None in Python > code (\ucsBug{22487}). Verified.
UCS 3.1-0 has been released: http://forum.univention.de/viewtopic.php?f=54&t=2125 If this error occurs again, please use "Clone This Bug".