Fix bandit [B101:assert_used]
This patch set refactors the usage of assert in the python code. The current implementation does not emit assert statement when optimization is requested at compile time (with command line option -O). Thus, it may not be behaving the way one assumes. Change-Id: If2f2cac86eeae1de5974971b50a2342d8458e97c
This commit is contained in:
parent
8bf4f7407d
commit
47b8d4d035
@ -648,9 +648,7 @@ def revision_tag_create(revision_id, tag, data=None, session=None):
|
||||
session = session or get_session()
|
||||
tag_model = models.RevisionTag()
|
||||
|
||||
try:
|
||||
assert not data or isinstance(data, dict)
|
||||
except AssertionError:
|
||||
if data and not isinstance(data, dict):
|
||||
raise errors.RevisionTagBadFormat(data=data)
|
||||
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user