class_docstr: Replace a KeyboardInterrupt with SystemExit(1)
  
  >>> def do_interrupt():
  ...     raise KeyboardInterrupt()
  >>> on_interrupt('error')(do_interrupt)()
  Traceback (most recent call last):
  ...
  SystemExit: 1
  >>> on_interrupt('error', code=255)(do_interrupt)()
  Traceback (most recent call last):
  ...
  SystemExit: 255
  >>> on_interrupt('suppress')(do_interrupt)()
  >>> with __import__('pytest').raises(KeyboardInterrupt):
  ...     on_interrupt('ignore')(do_interrupt)()
code: def __init__(
      self,
      action="error",
      # py3.7 compat
      # /,
      code=1,
  ):
      self.action = action
      self.code = code
  
imports: import os
  import subprocess
  import contextlib
  import functools
  import tempfile
  import shutil
  import operator
  import warnings
label_desc: Use image node_id 1 to create a new on_interrupt object from inherited base classes: contextlib with example: obj = on_interrupt(action, code)