Cannot create a HCondition with phrase=None
Bug #356253 reported by
Matt Goodall
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Hypy |
Fix Released
|
Low
|
Cory Dodt |
Bug Description
HCondition's __init__ is decorated with a unicodeToByte decorator and therefore calls enforceUnicode to check any positional or keyword args. Unfortunately, that means you cannot do HCondition(
It would be nice if ensureUnicode is conditionally called, e.g. for non-None args or the result of a "should I call ensureUnicode" function.
Note, It's an easy problem to work around but it's does make for slightly unintuitive code:
args = {}
if phrase:
args['phrase'] = phrase
cond = HCondition(**args)
Changed in hypy: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Looks like HDatabase.remove has the same potential issue.