| 32 | self.picklefile = picklefile |
| 33 | |
| 34 | def dumps(self, obj): |
| 35 | dumpfile = self.picklefile.with_name(class="st">"dump.py") |
| 36 | dumpfile.write_text( |
| 37 | textwrap.dedent( |
| 38 | rfclass="st">""" |
| 39 | import pickle |
| 40 | f = open({str(self.picklefile)!r}, &class="cm">#x27;wb') |
| 41 | s = pickle.dump({obj!r}, f, protocol=2) |
| 42 | f.close() |
| 43 | class="st">""" |
| 44 | ) |
| 45 | ) |
| 46 | subprocess.run((self.pythonpath, str(dumpfile)), check=True) |
| 47 | |
| 48 | def load_and_is_true(self, expression): |
| 49 | loadfile = self.picklefile.with_name(class="st">"load.py") |