Produce the data for a hash-based pyc.
(code, source_hash, checked=True)
| 519 | |
| 520 | |
| 521 | def _code_to_hash_pyc(code, source_hash, checked=True): |
| 522 | "Produce the data for a hash-based pyc." |
| 523 | data = bytearray(MAGIC_NUMBER) |
| 524 | flags = 0b1 | checked << 1 |
| 525 | data.extend(_pack_uint32(flags)) |
| 526 | assert len(source_hash) == 8 |
| 527 | data.extend(source_hash) |
| 528 | data.extend(marshal.dumps(code)) |
| 529 | return data |
| 530 | |
| 531 | |
| 532 | def decode_source(source_bytes): |
no test coverage detected
searching dependent graphs…