Commits

Ned Batchelder committed ea58fa6

Use pickle to store coverage data instead of marshal. Marshal is not guaranteed compatible across versions, although it is faster.

  • Participants
  • Parent commits 1c8450f

Comments (0)

Files changed (1)

File coverage/data.py

 """Coverage data for coverage.py"""
 
-import os, marshal, socket, types
+import os, socket, types
+import cPickle as pickle
 
 class CoverageData:
     """Manages collected coverage data."""
         """Write the coverage data to `filename`."""
         f = open(filename, 'wb')
         try:
-            marshal.dump(self.executed, f)
+            pickle.dump(self.executed, f)
         finally:
             f.close()
 
         """
         try:
             fdata = open(filename, 'rb')
-            executed = marshal.load(fdata)
+            executed = pickle.load(fdata)
             fdata.close()
             if isinstance(executed, types.DictType):
                 return executed