Skip to content
  • John Snow's avatar
    d1d14e59
    scripts/qmp-shell: Use context manager instead of atexit · d1d14e59
    John Snow authored
    
    
    We can invoke the shell history writing when we leave the QMPShell scope
    instead of relying on atexit. Doing so may be preferable to avoid global
    state being registered from within a class instead of from the
    application logic directly.
    
    Use QMP's context manager to hook this history saving at close time,
    which gets invoked when we leave the context block.
    
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
    Message-id: 20210607200649.1840382-32-jsnow@redhat.com
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
    d1d14e59
    scripts/qmp-shell: Use context manager instead of atexit
    John Snow authored
    
    
    We can invoke the shell history writing when we leave the QMPShell scope
    instead of relying on atexit. Doing so may be preferable to avoid global
    state being registered from within a class instead of from the
    application logic directly.
    
    Use QMP's context manager to hook this history saving at close time,
    which gets invoked when we leave the context block.
    
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
    Message-id: 20210607200649.1840382-32-jsnow@redhat.com
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
Loading