We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae59fd0 commit 9c32628Copy full SHA for 9c32628
serial/serialposix.py
@@ -518,10 +518,12 @@ def read(self, size=1):
518
return bytes(read)
519
520
def cancel_read(self):
521
- os.write(self.pipe_abort_read_w, b"x")
+ if self.is_open:
522
+ os.write(self.pipe_abort_read_w, b"x")
523
524
def cancel_write(self):
- os.write(self.pipe_abort_write_w, b"x")
525
526
+ os.write(self.pipe_abort_write_w, b"x")
527
528
def write(self, data):
529
"""Output the given byte string over the serial port."""
0 commit comments