aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>2019-04-22 12:28:07 -0700
committerGravatar GitHub <noreply@github.com>2019-04-22 12:28:07 -0700
commit3df307ad5920076675c0f6fde2cad4cf1638cf84 (patch)
tree669e73a9de8d4f6963af4fba6366458eaab22c80
parentc3d7aba0055eeb6d94c77fb8739fe4fbd8415985 (diff)
use immutable default arguments (#2341)
-rwxr-xr-xinfra/helper.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/infra/helper.py b/infra/helper.py
index 3c3499e1..bac3114a 100755
--- a/infra/helper.py
+++ b/infra/helper.py
@@ -96,12 +96,12 @@ def main():
check_build_parser = subparsers.add_parser(
'check_build', help='Checks that fuzzers execute without errors.')
_add_engine_args(check_build_parser, choices=['libfuzzer', 'afl'])
- _add_sanitizer_args(check_build_parser,
- choices=['address', 'memory', 'undefined'])
+ _add_sanitizer_args(
+ check_build_parser, choices=['address', 'memory', 'undefined'])
_add_environment_args(check_build_parser)
check_build_parser.add_argument('project_name', help='name of the project')
- check_build_parser.add_argument('fuzzer_name', help='name of the fuzzer',
- nargs='?')
+ check_build_parser.add_argument(
+ 'fuzzer_name', help='name of the fuzzer', nargs='?')
run_fuzzer_parser = subparsers.add_parser(
'run_fuzzer', help='Run a fuzzer in the emulated fuzzing environment.')
@@ -249,17 +249,17 @@ def _get_work_dir(project_name=''):
return os.path.join(BUILD_DIR, 'work', project_name)
-def _add_engine_args(parser, choices=None):
+def _add_engine_args(
+ parser,
+ choices=('libfuzzer', 'afl', 'honggfuzz', 'dataflow', 'none')):
"""Add common engine args."""
- if choices is None:
- choices = ['libfuzzer', 'afl', 'honggfuzz', 'dataflow', 'none']
parser.add_argument('--engine', default='libfuzzer', choices=choices)
-def _add_sanitizer_args(parser, choices=None):
+def _add_sanitizer_args(
+ parser,
+ choices=('address', 'memory', 'undefined', 'coverage', 'dataflow')):
"""Add common sanitizer args."""
- if choices is None:
- choices = ['address', 'memory', 'undefined', 'coverage', 'dataflow']
parser.add_argument('--sanitizer', default='address', choices=choices)