MCPcopy Index your code
hub / github.com/python/cpython / sound_func

Function sound_func

Lib/test/test_winsound.py:21–33  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

19# even *should* play. Instead of guessing, just call the function and assume
20# it either passed or raised the RuntimeError we expect in case of failure.
21def sound_func(func):
22 @functools.wraps(func)
23 def wrapper(*args, **kwargs):
24 try:
25 ret = func(*args, **kwargs)
26 except RuntimeError as e:
27 if support.verbose:
28 print(func.__name__, 'failed:', e)
29 else:
30 if support.verbose:
31 print(func.__name__, 'returned')
32 return ret
33 return wrapper
34
35
36safe_Beep = sound_func(winsound.Beep)

Callers 1

test_winsound.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…