"""The stagpy module is callable"""

from . import config


def main():
    """StagPy entry point"""
    args = config.parse_args()
    args.func(args)

if __name__ == '__main__':
    main()

"""The stagpy module is callable"""

import signal
import sys
from . import config


def sigint_handler(*_):
    """SIGINT handler"""
    print('\nSo long, and thanks for all the fish.')
    sys.exit()


def main():
    """StagPy entry point"""
    signal.signal(signal.SIGINT, sigint_handler)
    args = config.parse_args()
    args.func(args)

if __name__ == '__main__':
    main()

Handle SIGINT in a clean way
Handle SIGINT in a clean way

  """The stagpy module is callable"""
  
+ import signal
+ import sys
  from . import config
+ 
+ 
+ def sigint_handler(*_):
+     """SIGINT handler"""
+     print('\nSo long, and thanks for all the fish.')
+     sys.exit()
  
  
  def main():
      """StagPy entry point"""
+     signal.signal(signal.SIGINT, sigint_handler)
      args = config.parse_args()
      args.func(args)
  
  if __name__ == '__main__':
      main()
  
Handle SIGINT in a clean way
## Code Before:
"""The stagpy module is callable"""

from . import config


def main():
    """StagPy entry point"""
    args = config.parse_args()
    args.func(args)

if __name__ == '__main__':
    main()

## Instruction:
Handle SIGINT in a clean way
## Code After:
"""The stagpy module is callable"""

import signal
import sys
from . import config


def sigint_handler(*_):
    """SIGINT handler"""
    print('\nSo long, and thanks for all the fish.')
    sys.exit()


def main():
    """StagPy entry point"""
    signal.signal(signal.SIGINT, sigint_handler)
    args = config.parse_args()
    args.func(args)

if __name__ == '__main__':
    main()
