mitogen: Log skipped termios attributes

refs #1121
pull/1244/head
Alex Willmer 10 months ago
parent 5f42da36f3
commit 927fb172d8

@ -21,6 +21,7 @@ To avail of fixes in an unreleased version, please download a ZIP file
In progress (unreleased)
------------------------
* :gh:issue:`1121` :mod:`mitogen`: Log skipped :py:mod:`termios` attributes
v0.3.22 (2025-02-04)

@ -224,8 +224,16 @@ def flags(names):
Return the result of ORing a set of (space separated) :py:mod:`termios`
module constants together.
"""
return sum(getattr(termios, name, 0)
for name in names.split())
i = 0
skipped = []
for name in names.split():
try:
i |= getattr(termios, name)
except AttributeError:
skipped.append(name)
if skipped:
LOG.debug('Skipped termios attributes: %s', ', '.join(skipped))
return i
def cfmakeraw(tflags):

Loading…
Cancel
Save