A decorator that makes an exception class look like its base. We use this to hide subclasses that are implementation details - the user should catch the base type, which is what the traceback will show them. Classes decorated with this decorator are subject to removal without a
(cls)
| 15 | |
| 16 | |
| 17 | def _display_as_base(cls): |
| 18 | """ |
| 19 | A decorator that makes an exception class look like its base. |
| 20 | |
| 21 | We use this to hide subclasses that are implementation details - the user |
| 22 | should catch the base type, which is what the traceback will show them. |
| 23 | |
| 24 | Classes decorated with this decorator are subject to removal without a |
| 25 | deprecation warning. |
| 26 | """ |
| 27 | assert issubclass(cls, Exception) |
| 28 | cls.__name__ = cls.__base__.__name__ |
| 29 | return cls |
| 30 | |
| 31 | |
| 32 | class UFuncTypeError(TypeError): |
nothing calls this directly
no outgoing calls
no test coverage detected