]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't crash if an explicitly specified backport extension is not found
authorMikko Rasa <tdb@tdb.fi>
Sun, 10 Sep 2017 11:28:38 +0000 (14:28 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 10 Sep 2017 11:28:38 +0000 (14:28 +0300)
Also fix formatting of the error message.

scripts/extgen.py

index b3319e5937d401c2b5ed08e5cd645a041e2a03b3..c7c06b2c07c115a11bf6986f8f52d2761ef87999 100755 (executable)
@@ -375,10 +375,11 @@ if backport_ext:
        if backport_ext=="none":
                backport_ext = None
        else:
-               backport_ext = extensions[backport_ext]
+               bpe_name = backport_ext
+               backport_ext = extensions.get(backport_ext)
 
                if backport_ext not in backport_ext_candidates:
-                       print "Warning: explicitly specified backport extension %s does not look like a backport extension"
+                       print "Warning: explicitly specified backport extension %s does not look like a backport extension"%bpe_name
 elif backport_ext_candidates:
        if len(backport_ext_candidates)>1:
                print "Warning: multiple backport extension candidates: %s"%(" ".join(e.name for e in backport_ext_candidates))