Exemplo n.º 1
0
def halt(interp, s_frame, w_rcvr):
    print s_frame.print_stack()
    from rpython.config.translationoption import get_translation_config
    from rpython.rlib.objectmodel import we_are_translated
    if not we_are_translated() or get_translation_config().translation.lldebug or get_translation_config().translation.lldebug0:
        import pdb; pdb.set_trace()
    raise error.PrimitiveFailedError
Exemplo n.º 2
0
def test_get_translation_config():
    from rpython.translator.interactive import Translation
    from rpython.config import config
    def f(x):
        config = get_translation_config()
        if config is not None:
            return config.translating
        return False

    t = Translation(f, [int])
    config = t.config

    # do the patching
    t.annotate()
    retvar = t.context.graphs[0].returnblock.inputargs[0]
    assert t.context.annotator.binding(retvar).const

    assert get_translation_config() is config # check during import time
Exemplo n.º 3
0
def test_get_translation_config():
    from rpython.translator.interactive import Translation
    from rpython.config import config

    def f(x):
        config = get_translation_config()
        if config is not None:
            return config.translating
        return False

    t = Translation(f, [int])
    config = t.config

    # do the patching
    t.annotate()
    retvar = t.context.graphs[0].returnblock.inputargs[0]
    assert t.context.annotator.binding(retvar).const

    assert get_translation_config() is config  # check during import time
Exemplo n.º 4
0
 def f(x):
     config = get_translation_config()
     if config is not None:
         return config.translating
     return False
Exemplo n.º 5
0
 def f(x):
     config = get_translation_config()
     if config is not None:
         return config.translating
     return False