diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2015-01-07 17:11:19 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2015-01-07 17:11:19 -0500 |
commit | 087e497ab5776d54da7ee0ae4550679c65df28e4 (patch) | |
tree | 9868b6642c03589b097ca69fd51258961c78be61 /indra/newview | |
parent | 8ec4e83d5d9535de3b109728cc5e810770d4a749 (diff) |
Replace reduce(operator.or_, ...) with any(...).
The any() builtin was introduced in Python 2.5. Not only is its intent
clearer, but it handles the case of zero items -- which the reduce(or_)
construct does not. Sporadically we've seen exceptions from
generate_breakpad_symbols.py when reduce(or_, ...) is given zero items. This
masks the actual error (failure to dump symbols? failure to read them?),
masquerading as a bug in the Python script.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/generate_breakpad_symbols.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/indra/newview/generate_breakpad_symbols.py b/indra/newview/generate_breakpad_symbols.py index 4181e4ebb3..d351c406bc 100755 --- a/indra/newview/generate_breakpad_symbols.py +++ b/indra/newview/generate_breakpad_symbols.py @@ -31,7 +31,6 @@ $/LicenseInfo$ import collections import fnmatch import itertools -import operator import os import re import sys @@ -149,7 +148,7 @@ def main(configuration, search_dirs, viewer_exes, libs_suffix, dump_syms_tool, v == os.path.splitext(os.path.basename(m))[0].lower() # there must be at least one .sym file in tarfile_members that matches # each required module (ignoring file extensions) - if not reduce(operator.or_, itertools.imap(match_module_basename, tarfile_members)): + if not any(itertools.imap(match_module_basename, tarfile_members)): print >> sys.stderr, "failed to find required %s in generated %s" \ % (required_module, viewer_symbol_file) os.remove(viewer_symbol_file) |