mirror of https://gitlab.com/ita1024/waf.git
Let waf -v catch invalid string on hcode values in Python3
This commit is contained in:
parent
c755de45c7
commit
d4334adfb9
|
@ -22,6 +22,7 @@ typos = {
|
||||||
|
|
||||||
meths_typos = ['__call__', 'program', 'shlib', 'stlib', 'objects']
|
meths_typos = ['__call__', 'program', 'shlib', 'stlib', 'objects']
|
||||||
|
|
||||||
|
import sys
|
||||||
from waflib import Logs, Build, Node, Task, TaskGen, ConfigSet, Errors, Utils
|
from waflib import Logs, Build, Node, Task, TaskGen, ConfigSet, Errors, Utils
|
||||||
import waflib.Tools.ccroot
|
import waflib.Tools.ccroot
|
||||||
|
|
||||||
|
@ -84,6 +85,9 @@ def check_invalid_constraints(self):
|
||||||
|
|
||||||
# the build scripts have been read, so we can check for invalid after/before attributes on task classes
|
# the build scripts have been read, so we can check for invalid after/before attributes on task classes
|
||||||
for cls in list(Task.classes.values()):
|
for cls in list(Task.classes.values()):
|
||||||
|
if sys.hexversion > 0x3000000 and issubclass(cls, Task.Task) and isinstance(cls.hcode, str):
|
||||||
|
raise Errors.WafError('Class %r has hcode value %r of type <str>, expecting <bytes> (use Utils.h_cmd() ?)' % (cls, cls.hcode))
|
||||||
|
|
||||||
for x in ('before', 'after'):
|
for x in ('before', 'after'):
|
||||||
for y in Utils.to_list(getattr(cls, x, [])):
|
for y in Utils.to_list(getattr(cls, x, [])):
|
||||||
if not Task.classes.get(y, None):
|
if not Task.classes.get(y, None):
|
||||||
|
|
Loading…
Reference in New Issue