From: Bernhard Reutner-Fischer Date: Sun, 14 Nov 2010 12:08:03 +0000 (+0100) Subject: BBHandler: simplify supports() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=858d704d713d15bf97053eb1374758c74b0d8874;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git BBHandler: simplify supports() Signed-off-by: Bernhard Reutner-Fischer --- diff --git a/lib/bb/parse/parse_py/BBHandler.py b/lib/bb/parse/parse_py/BBHandler.py index bda6acc943e..ebc2d5aeb0f 100644 --- a/lib/bb/parse/parse_py/BBHandler.py +++ b/lib/bb/parse/parse_py/BBHandler.py @@ -65,7 +65,8 @@ IN_PYTHON_EOF = -9999999999999 def supports(fn, d): - return fn[-3:] == ".bb" or fn[-8:] == ".bbclass" or fn[-4:] == ".inc" + """Return True if fn has a supported extension""" + return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"] def inherit(files, d): __inherit_cache = data.getVar('__inherit_cache', d) or []