Also protect static methods in mustHaveApp classes

This commit is contained in:
Robin Dunn
2017-01-21 18:59:08 -08:00
parent 6c65fbb865
commit bd0927fb02

View File

@@ -428,10 +428,11 @@ from .%s import *
if klass.ignored:
return
# Propagate mustHaveApp setting to the ctors
# Propagate mustHaveApp setting to the ctors and static methods
if klass.mustHaveAppFlag:
for item in klass.allItems():
if isinstance(item, extractors.MethodDef) and item.isCtor:
if isinstance(item, extractors.MethodDef) and \
(item.isCtor or item.isStatic):
item.mustHaveApp(True)
# write the class header