62 def save(self): |
63 def save(self): |
63 """ |
64 """ |
64 Public method to store the collected profile data. |
65 Public method to store the collected profile data. |
65 """ |
66 """ |
66 # dump the raw timing data |
67 # dump the raw timing data |
67 try: |
68 with contextlib.suppress(OSError), \ |
68 with open(self.timingCache, 'wb') as cache: |
69 open(self.timingCache, 'wb') as cache: |
69 marshal.dump(self.timings, cache) |
70 marshal.dump(self.timings, cache) |
70 except OSError: |
|
71 pass |
|
72 |
71 |
73 # dump the profile data |
72 # dump the profile data |
74 self.dump_stats(self.profileCache) |
73 self.dump_stats(self.profileCache) |
75 |
74 |
76 def dump_stats(self, file): |
75 def dump_stats(self, file): |