def send_signal(self, sig):
<EOL>if not self.is_running():<EOL><INDENT>name = self._platform_impl._process_name<EOL>raise NoSuchProcess(self.pid, name)<EOL><DEDENT>if os.name == '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>os.kill(self.pid, sig)<EOL><DEDENT>except OSError:<EOL><INDENT>err = sys.exc_info()[<NUM_LIT:1>]<EOL>name = self._platform_impl._process_name<EOL>if err.errno == errno.ESRCH:<EOL><INDENT>raise NoSuchProcess(self.pid, name)<EOL><DEDENT>if err.errno == errno.EPERM:<EOL><INDENT>raise AccessDenied(self.pid, name)<EOL><DEDENT>raise<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if sig == signal.SIGTERM:<EOL><INDENT>self._platform_impl.kill_process()<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>
Send a signal to process (see signal module constants).
        On Windows only SIGTERM is valid and is treated as an alias
        for kill().