]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
BBHandler: simplify supports()
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Sun, 14 Nov 2010 12:08:03 +0000 (13:08 +0100)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 15 Nov 2010 15:28:10 +0000 (16:28 +0100)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
lib/bb/parse/parse_py/BBHandler.py

index bda6acc943e0be88479b7c68838e4b46def9303a..ebc2d5aeb0f8e98bbe93e3c71b22d9468cd747f2 100644 (file)
@@ -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 []