MCPcopy Index your code
hub / github.com/python/cpython / _add_ci_python_opts

Method _add_ci_python_opts

Lib/test/libregrtest/main.py:645–672  ·  view source on GitHub ↗
(self, python_opts, keep_environ)

Source from the content-addressed store, hash-verified

643 return (environ, keep_environ)
644
645 def _add_ci_python_opts(self, python_opts, keep_environ):
646 # --fast-ci and --slow-ci add options to Python.
647 #
648 # Some platforms run tests in embedded mode and cannot change options
649 # after startup, so if this function changes, consider also updating:
650 # * gradle_task in Android/android.py
651
652 # Unbuffered stdout and stderr. This isn't helpful on Android, because
653 # it would cause lines to be split into multiple log messages.
654 if not sys.stdout.write_through and sys.platform != "android":
655 python_opts.append('-u')
656
657 # Add warnings filter 'error', unless the user specified a different
658 # filter. Ignore BytesWarning since it's controlled by '-b' below.
659 if not [
660 opt for opt in sys.warnoptions
661 if not opt.endswith("::BytesWarning")
662 ]:
663 python_opts.extend(('-W', 'error'))
664
665 # Error on bytes/str comparison
666 if sys.flags.bytes_warning < 2:
667 python_opts.append('-bb')
668
669 if not keep_environ:
670 # Ignore PYTHON* environment variables
671 if not sys.flags.ignore_environment:
672 python_opts.append('-E')
673
674 def _execute_python(self, cmd, environ):
675 # Make sure that messages before execv() are logged

Callers 1

_add_python_optsMethod · 0.95

Calls 3

appendMethod · 0.45
endswithMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected