py35compat.py 455 B

12345678910111213141516171819
  1. import sys
  2. import subprocess
  3. def __optim_args_from_interpreter_flags():
  4. """Return a list of command-line arguments reproducing the current
  5. optimization settings in sys.flags."""
  6. args = []
  7. value = sys.flags.optimize
  8. if value > 0:
  9. args.append("-" + "O" * value)
  10. return args
  11. _optim_args_from_interpreter_flags = getattr(
  12. subprocess,
  13. "_optim_args_from_interpreter_flags",
  14. __optim_args_from_interpreter_flags,
  15. )