code: def get_exitcode(self, fail_env_changed, fail_rerun):
      exitcode = 0
      if self.bad:
          exitcode = EXITCODE_BAD_TEST
      elif self.interrupted:
          exitcode = EXITCODE_INTERRUPTED
      elif fail_env_changed and self.env_changed:
          exitcode = EXITCODE_ENV_CHANGED
      elif self.no_tests_run():
          exitcode = EXITCODE_NO_TESTS_RAN
      elif fail_rerun and self.rerun:
          exitcode = EXITCODE_RERUN_FAIL
      elif self.worker_bug:
          exitcode = EXITCODE_BAD_TEST
      return exitcode
  
file_path: cpython/Lib/test/libregrtest/results.py
imports: import sys
  import trace
  from .runtests import RunTests
  from .result import State, TestResult, TestStats, Location
  from .utils import StrPath, TestName, TestTuple, TestList, FilterDict, printlist, count, format_duration
label_desc: Use image node_id 6 for calling the TestResults obj's underlying member method code with example usage: obj.get_exitcode(fail_env_changed, fail_rerun) and returns: exitcode