Used to re-raise AttributeErrors caught during authentication, preventing these errors from otherwise being handled by the attribute access protocol.
()
| 66 | |
| 67 | @contextmanager |
| 68 | def wrap_attributeerrors(): |
| 69 | """ |
| 70 | Used to re-raise AttributeErrors caught during authentication, preventing |
| 71 | these errors from otherwise being handled by the attribute access protocol. |
| 72 | """ |
| 73 | try: |
| 74 | yield |
| 75 | except AttributeError: |
| 76 | info = sys.exc_info() |
| 77 | exc = WrappedAttributeError(str(info[1])) |
| 78 | raise exc.with_traceback(info[2]) |
| 79 | |
| 80 | |
| 81 | class Empty: |
no test coverage detected