Produce the data for a hash-based pyc.
(code, source_hash, checked=True)
| 530 | |
| 531 | |
| 532 | def _code_to_hash_pyc(code, source_hash, checked=True): |
| 533 | "Produce the data for a hash-based pyc." |
| 534 | data = bytearray(MAGIC_NUMBER) |
| 535 | flags = 0b1 | checked << 1 |
| 536 | data.extend(_pack_uint32(flags)) |
| 537 | assert len(source_hash) == 8 |
| 538 | data.extend(source_hash) |
| 539 | data.extend(marshal.dumps(code)) |
| 540 | return data |
| 541 | |
| 542 | |
| 543 | def decode_source(source_bytes): |
no test coverage detected