(func)
| 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. |
| 21 | def 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 | |
| 36 | safe_Beep = sound_func(winsound.Beep) |
no outgoing calls
no test coverage detected
searching dependent graphs…