def in_interactive_inspect_mode():
    """Whether '-i' option is present or PYTHONINSPECT is not empty."""
if os.environ.get('PYTHONINSPECT'):
    return True
iflag_ptr = cast(pythonapi.Py_InteractiveFlag, POINTER(c_int))
return iflag_ptr.contents.value != 0
tell whether python is in -i mode