def build(args):
    builder = None
    fail = False
    try:
        manifest = None

        with open(args.manifest, 'r') as fh:
            manifest = fh.read()

        buildspec = BuildSpec(manifest, args.version, args.type, args.parallel,
                              args.projects)
        builder = BuilderFactory.create_builder(args.type, buildspec)

        def _signal_handler(*args):
            LOG.info("Process interrrupted. Cleaning up.")
            builder.cleanup()
            sys.exit()
        signal.signal(signal.SIGINT, _signal_handler)

        rc = builder.build()
    except Exception as e:
        LOG.exception("Oops something went wrong: %s", e)
        fail = True

    builder.cleanup()
    if fail:
        sys.exit(-1)
    sys.exit(rc)
Close the handler.
dataset/ETHPy150Open blueboxgroup/giftwrap/giftwrap/shell.py/build--crossover with--dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/logging/handlers.py/BufferingHandler.close