Skip to content

Commit 44f2803

Browse files
panlinuxbenhoyt
authored andcommitted
terminal: handle BlockingIOError in addition to TypeError
Handle BlockingIOError in addition to TypeError for non-blocking read() in terminal.py, since python 3.14 raises BlockingIOError instead of TypeError when there is nothing to read. LP: #2138802
1 parent 09402c6 commit 44f2803

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

netplan_cli/terminal.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ def get_confirmation_input(self, timeout=120, message=None): # pragma: nocover
9696
self.reset(settings)
9797
# Yay, user has accepted the changes!
9898
raise InputAccepted()
99-
except TypeError:
99+
except (TypeError, BlockingIOError):
100100
# read() above is non-blocking, if there is nothing to read it
101-
# will return TypeError, which we should ignore -- on to the
101+
# will return TypeError or, since python 3.14, BlockingIOError,
102+
# which we should ignore -- on to the
102103
# next iteration until timeout.
103104
pass
104105
timeout_now -= 1

0 commit comments

Comments
 (0)