Special support for pickling os.stat and os.stat_vfs results portably

(the types come from different modules on different platforms).

Added tests for pickling these types.

May be a bugfix candidate.
This commit is contained in:
Michael W. Hudson 2002-03-06 17:11:18 +00:00
parent ce358e3015
commit 0e02530a79
2 changed files with 31 additions and 0 deletions

View file

@ -254,6 +254,17 @@ class AbstractPickleTests(unittest.TestCase):
s = self.dumps(t)
u = self.loads(s)
self.assertEqual(t, u)
import os
if hasattr(os, "stat"):
t = os.stat(os.curdir)
s = self.dumps(t)
u = self.loads(s)
self.assertEqual(t, u)
if hasattr(os, "statvfs"):
t = os.statvfs(os.curdir)
s = self.dumps(t)
u = self.loads(s)
self.assertEqual(t, u)
class AbstractPickleModuleTests(unittest.TestCase):