1#!/usr/bin/env python 2# Copyright 2019 The Chromium Authors 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6"""Script for use in test_env unittests.""" 7 8from __future__ import print_function 9import signal 10import sys 11import time 12 13 14def print_signal(sig, *_args): 15 print('Signal :{}'.format(sig)) 16 17 18if __name__ == '__main__': 19 signal.signal(signal.SIGTERM, print_signal) 20 signal.signal(signal.SIGINT, print_signal) 21 if sys.platform == 'win32': 22 signal.signal(signal.SIGBREAK, print_signal) # pylint: disable=no-member 23 time.sleep(2) # gives process time to receive signal. 24