diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-08-31 21:14:49 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-08-31 21:14:49 -0400 |
| commit | 425dfd5ef9bd1963ba6224d6519162e276732d47 (patch) | |
| tree | 1a4eab3459bb1ca8d5f093d8521ac77cc83530a7 /setuptools/_distutils/py35compat.py | |
| parent | 17cb9d6bf249cefe653d3bdb712582409035a7db (diff) | |
| parent | ae27e13a663cc53d15632e884f7b4d601a8605dc (diff) | |
| download | python-setuptools-git-425dfd5ef9bd1963ba6224d6519162e276732d47.tar.gz | |
Merge branch 'clean' of https://github.com/pypa/distutils into master
Diffstat (limited to 'setuptools/_distutils/py35compat.py')
| -rw-r--r-- | setuptools/_distutils/py35compat.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/setuptools/_distutils/py35compat.py b/setuptools/_distutils/py35compat.py new file mode 100644 index 00000000..79b2e7f3 --- /dev/null +++ b/setuptools/_distutils/py35compat.py @@ -0,0 +1,19 @@ +import sys +import subprocess + + +def __optim_args_from_interpreter_flags(): + """Return a list of command-line arguments reproducing the current + optimization settings in sys.flags.""" + args = [] + value = sys.flags.optimize + if value > 0: + args.append("-" + "O" * value) + return args + + +_optim_args_from_interpreter_flags = getattr( + subprocess, + "_optim_args_from_interpreter_flags", + __optim_args_from_interpreter_flags, +) |
