Dump the bytecode into the file or file like object passed.
(self, f)
| 70 | self.code = marshal.loads(f.read()) |
| 71 | |
| 72 | def write_bytecode(self, f): |
| 73 | """Dump the bytecode into the file or file like object passed.""" |
| 74 | if self.code is None: |
| 75 | raise TypeError('can\'t write empty bucket') |
| 76 | f.write(bc_magic) |
| 77 | pickle.dump(self.checksum, f, 2) |
| 78 | if isinstance(f, file): |
| 79 | marshal.dump(self.code, f) |
| 80 | else: |
| 81 | f.write(marshal.dumps(self.code)) |
| 82 | |
| 83 | def bytecode_from_string(self, string): |
| 84 | """Load bytecode from a string.""" |
no test coverage detected