diff options
author | Sree Kuchibhotla <sreecha@users.noreply.github.com> | 2016-01-12 15:21:49 -0800 |
---|---|---|
committer | Sree Kuchibhotla <sreecha@users.noreply.github.com> | 2016-01-12 15:21:49 -0800 |
commit | 69ff3d3373e985ba7deba11bd854e95623af9b54 (patch) | |
tree | a28723956bccb7da9e6287a4faae12681f67c170 | |
parent | 0ade2d415ff5dbc9fca7b942809ef7179db08ef7 (diff) | |
parent | 4518bf7f108b80445365f8d70da777a648fbe0f5 (diff) |
Merge pull request #4693 from murgatroid99/transitive_deps_plugin_fix
Allow transitive dependencies plugin to process non-existent libs wit…
-rw-r--r-- | tools/buildgen/plugins/transitive_dependencies.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/buildgen/plugins/transitive_dependencies.py b/tools/buildgen/plugins/transitive_dependencies.py index 1fc76a3cd5..01e7f61ea9 100644 --- a/tools/buildgen/plugins/transitive_dependencies.py +++ b/tools/buildgen/plugins/transitive_dependencies.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -36,10 +36,13 @@ of the list of dependencies. """ def get_lib(libs, name): - return next(lib for lib in libs if lib['name']==name) + try: + return next(lib for lib in libs if lib['name']==name) + except StopIteration: + return None def transitive_deps(lib, libs): - if 'deps' in lib: + if lib is not None and 'deps' in lib: # Recursively call transitive_deps on each dependency, and take the union return set.union(set(lib['deps']), *[set(transitive_deps(get_lib(libs, dep), libs)) |