Ignore failures to beep

This commit is contained in:
Kovid Goyal 2017-02-11 09:50:19 +05:30
parent 91144a8b63
commit 41ffad8e5c

View File

@ -108,8 +108,11 @@ class Window:
wakeup()
def bell(self):
with open('/dev/tty', 'wb') as f:
f.write(b'\007')
try:
with open('/dev/tty', 'wb') as f:
f.write(b'\007')
except EnvironmentError:
pass # failure to beep is not critical
if self.opts.visual_bell_duration > 0:
self.start_visual_bell_at = monotonic()
glfw_post_empty_event()