Skip to content

Commit 0752311

Browse files
Remove support for Python 2 fuzzers. (google#1949)
* Remove support for Python 2 fuzzers. * Fix use of is_blackbox_fuzzer.
1 parent 07c1ba3 commit 0752311

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

src/python/bot/tasks/fuzz_task.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,10 +1474,7 @@ def generate_blackbox_testcases(self, fuzzer, fuzzer_directory,
14741474
return error_occurred, None, None, None, None
14751475

14761476
# Build the fuzzer command execution string.
1477-
# TODO(mbarbella): Conditionally invoke with Python 2 depending on
1478-
# the fuzzer. At present, all were implemented to work with Python 2.
1479-
command = shell.get_execute_command(
1480-
fuzzer_executable, is_blackbox_fuzzer=True)
1477+
command = shell.get_execute_command(fuzzer_executable)
14811478

14821479
# NodeJS and shell script expect space seperator for arguments.
14831480
if command.startswith('node ') or command.startswith('sh '):

src/python/bot/testcase_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,7 @@ def get_command_line_for_application(file_to_run='',
939939
# have app_name == launcher. In this case don't prepend launcher to
940940
# command - just use app_name.
941941
if os.path.basename(launcher) != app_name:
942-
launcher_with_interpreter = shell.get_execute_command(
943-
launcher, is_blackbox_fuzzer=True)
942+
launcher_with_interpreter = shell.get_execute_command(launcher)
944943
command += launcher_with_interpreter + ' '
945944
elif is_android:
946945
# Android-specific testcase path fixup for fuzzers that don't rely on

src/python/system/process_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def run_process(cmdline,
307307
# If the process is still running, then terminate it.
308308
if not process_status.finished:
309309
launcher_with_interpreter = shell.get_execute_command(
310-
launcher, is_blackbox_fuzzer=True) if launcher else None
310+
launcher) if launcher else None
311311
if (launcher_with_interpreter and
312312
cmdline.startswith(launcher_with_interpreter)):
313313
# If this was a launcher script, we KILL all child processes created

src/python/system/shell.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def get_free_disk_space(path='/'):
351351
return psutil.disk_usage(path).free
352352

353353

354-
def get_interpreter(file_to_execute, is_blackbox_fuzzer=False):
354+
def get_interpreter(file_to_execute):
355355
"""Gives the interpreter needed to execute |file_to_execute|."""
356356
interpreters = {
357357
'.bash': 'bash',
@@ -368,19 +368,12 @@ def get_interpreter(file_to_execute, is_blackbox_fuzzer=False):
368368
except KeyError:
369369
return None
370370

371-
# TODO(mbarbella): Remove this when fuzzers have been migrated to Python 3.
372-
if (is_blackbox_fuzzer and interpreter == sys.executable and
373-
environment.get_value('USE_PYTHON2_FOR_BLACKBOX_FUZZERS') and
374-
sys.version_info.major == 3):
375-
interpreter = 'python2'
376-
377371
return interpreter
378372

379373

380-
def get_execute_command(file_to_execute, is_blackbox_fuzzer=False):
374+
def get_execute_command(file_to_execute):
381375
"""Return command to execute |file_to_execute|."""
382-
interpreter_path = get_interpreter(
383-
file_to_execute, is_blackbox_fuzzer=is_blackbox_fuzzer)
376+
interpreter_path = get_interpreter(file_to_execute)
384377

385378
# Hack for Java scripts.
386379
file_to_execute = file_to_execute.replace('.class', '')

0 commit comments

Comments
 (0)