sys.get_frame_from_call_stack

Here are the examples of the python api sys.get_frame_from_call_stack taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

Example 1

Project: pyrecord Source File: __init__.py
Function: get_client_module_name
def _get_client_module_name():
    client_module_name = None
    for stack_index in range(1, 5):
        frame = get_frame_from_call_stack(stack_index)
        module_name = frame.f_globals.get("__name__")
        if module_name != __name__:
            client_module_name = module_name
            break

    assert client_module_name, "Could not find name of module using PyRecord"
    return client_module_name