| 3316 | self.process_payload(payload) |
| 3317 | |
| 3318 | def send_interrupt(self): |
| 3319 | if self.interrupt_sock is not None: |
| 3320 | # Write to a socket that the PDB server listens on. This triggers |
| 3321 | # the remote to raise a SIGINT for itself. We do this because |
| 3322 | # Windows doesn't allow triggering SIGINT remotely. |
| 3323 | # See https://stackoverflow.com/a/35792192 for many more details. |
| 3324 | self.interrupt_sock.sendall(signal.SIGINT.to_bytes()) |
| 3325 | else: |
| 3326 | # On Unix we can just send a SIGINT to the remote process. |
| 3327 | # This is preferable to using the signal thread approach that we |
| 3328 | # use on Windows because it can interrupt IO in the main thread. |
| 3329 | os.kill(self.pid, signal.SIGINT) |
| 3330 | |
| 3331 | def process_payload(self, payload): |
| 3332 | match payload: |