(path, key)
| 43 | |
| 44 | |
| 45 | def _read_memory_stat(path, key): |
| 46 | try: |
| 47 | with open(path) as f: |
| 48 | for line in f: |
| 49 | name, _, value = line.partition(" ") |
| 50 | if name == key: |
| 51 | return int(value) |
| 52 | except (OSError, ValueError): |
| 53 | pass |
| 54 | return 0 |
| 55 | |
| 56 | |
| 57 | def _path_parts(path): |
no test coverage detected