This is an automatically generated e-mail. To reply, visit: http://reviewboard-fedoraserver.rhcloud.com/r/17/ |
On červenec 21st, 2014, 8:33 odp. CEST, Miloslav Trmac wrote:
src/rolekit/server/rolebase.py (Diff revision 1) def get_property(x, prop):165 except:
- Because the method returns None, this doesn’t fire.
- Blind “except:” is evil. Either define a specific exception type for this, or at the very least an unique object:
PropertyNotRecognizedValue = object();
globally, then
v = x.do_get_property(…)
if v is not PropertyNotRecognizedValue:
return v
(Or is there a guarantee that None can never be a valid property value? If so, None could be used instead of PropertyNotRecognizedValue.)
On červenec 21st, 2014, 8:33 odp. CEST, Miloslav Trmac wrote:
src/rolekit/server/rolebase.py (Diff revision 1) def get_dbus_property(x, prop):194 except:
- Because the method returns None, this doesn’t fire.
- Blind “except:” is evil. Either define a specific exception type for this, or at the very least an unique object:
PropertyNotRecognizedValue = object();
globally, then
v = x.do_get_property(…)
if v is not PropertyNotRecognizedValue:
return v
(Or is there a guarantee that None can never be a valid property value? If so, None could be used instead of PropertyNotRecognizedValue.)
- Miloslav
On červenec 21st, 2014, 3:16 odp. CEST, Thomas Woerner wrote:
Review request for RoleKit Mailing List, Stephen Gallagher and Thomas Woerner.
By Thomas Woerner.
Updated Čec. 21, 2014, 3:16 odp.
Repository:
rolekit
Description
Diffs
|