| Conditions | 5 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | 1 | import os |
|
| 13 | 1 | def _load(self): |
|
| 14 | 1 | try: |
|
| 15 | 1 | with open(self.PATH, 'rb') as fin: |
|
| 16 | 1 | text = fin.read() |
|
| 17 | 1 | except IOError: |
|
| 18 | 1 | text = None |
|
| 19 | |||
| 20 | 1 | try: |
|
| 21 | 1 | data = pickle.loads(text) |
|
| 22 | 1 | except (TypeError, KeyError, IndexError): |
|
| 23 | 1 | data = None |
|
| 24 | |||
| 25 | 1 | if isinstance(data, dict): |
|
| 26 | 1 | self._data = data |
|
| 27 | |||
| 49 |