Skip to content

ContextManager - missing 3 required positional arguments: 'exc_type', 'exc_val', and 'exc_tb' #758

@Tusenka

Description

@Tusenka

Given:

def get_session():
    class _SessionContext:
        def __init__(self):
            print("init")

        def __enter__(self):
            return "enter"

        def __exit__(self, exc_type, exc_val, exc_tb):
            print("exit")
    return _SessionContext()

@codon.jit(pyvars=['get_session'])
def main():
    with get_session() as session:
        print(session)

main()

Expected:
Success execution

Actual:
Error is missing 3 required positional arguments: 'exc_type', 'exc_val', and 'exc_tb'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions