| 636 | |
| 637 | |
| 638 | class HaskKeyCrasher: |
| 639 | def __init__(self, *, error_on_hash=False, error_on_eq=False): |
| 640 | self.error_on_hash = error_on_hash |
| 641 | self.error_on_eq = error_on_eq |
| 642 | |
| 643 | def __enter__(self): |
| 644 | if HashKey._crasher is not None: |
| 645 | raise RuntimeError('cannot nest crashers') |
| 646 | HashKey._crasher = self |
| 647 | |
| 648 | def __exit__(self, *exc): |
| 649 | HashKey._crasher = None |
| 650 | |
| 651 | |
| 652 | class HashingError(Exception): |
no outgoing calls
searching dependent graphs…