make gdb skip expected

This commit is contained in:
Benjamin Peterson 2010-10-29 21:31:35 +00:00
parent 9f5db07dab
commit 65c66ab255
3 changed files with 19 additions and 11 deletions

View file

@ -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.