]> Git Repo - qemu.git/commit - scripts/qapi/common.py
qapi: leave the ifcond attribute undefined until check()
authorMarc-André Lureau <[email protected]>
Tue, 3 Jul 2018 15:56:37 +0000 (17:56 +0200)
committerMarkus Armbruster <[email protected]>
Tue, 3 Jul 2018 16:38:53 +0000 (18:38 +0200)
commit4fca21c1b043cb1ef2e197ef15e7474ba668d925
tree6237a61aae6f4a377e3351c80928014fe886c063
parent2cbc94376e718448699036be7f6e29ab75312b70
qapi: leave the ifcond attribute undefined until check()

We commonly initialize attributes to None in .init(), then set their
real value in .check().  Accessing the attribute before .check()
yields None.  If we're lucky, the code that accesses the attribute
prematurely chokes on None.

It won't for .ifcond, because None is a legitimate value.

Leave the ifcond attribute undefined until check().

Suggested-by: Markus Armbruster <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20180703155648[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
scripts/qapi/common.py
This page took 0.025104 seconds and 4 git commands to generate.