mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
make gdb skip expected
This commit is contained in:
parent
9f5db07dab
commit
65c66ab255
3 changed files with 19 additions and 11 deletions
|
@ -20,6 +20,9 @@ import re
|
|||
import subprocess
|
||||
import imp
|
||||
import time
|
||||
import sysconfig
|
||||
|
||||
|
||||
try:
|
||||
import _thread
|
||||
except ImportError:
|
||||
|
@ -885,6 +888,16 @@ def gc_collect():
|
|||
gc.collect()
|
||||
|
||||
|
||||
def python_is_optimized():
|
||||
"""Find if Python was built with optimizations."""
|
||||
cflags = sysconfig.get_config_vars()['PY_CFLAGS']
|
||||
final_opt = ""
|
||||
for opt in cflags.split():
|
||||
if opt.startswith('-O'):
|
||||
final_opt = opt
|
||||
return final_opt and final_opt != '-O0'
|
||||
|
||||
|
||||
#=======================================================================
|
||||
# Decorator for running a function in a different locale, correctly resetting
|
||||
# it afterwards.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue