# portable than they had been thought to be.
import os
+import errno
import unittest
import warnings
import sys
result = os.statvfs(self.fname)
except OSError, e:
# On AtheOS, glibc always returns ENOSYS
- import errno
if e.errno == errno.ENOSYS:
return
locals()["test_"+f] = get_single(f)
def check(self, f, *args):
- self.assertRaises(OSError, f, test_support.make_bad_fd(), *args)
+ try:
+ f(test_support.make_bad_fd(), *args)
+ except OSError as e:
+ self.assertEqual(e.errno, errno.EBADF)
+ else:
+ self.fail("%r didn't raise a OSError with a bad file descriptor"
+ % f)
def test_isatty(self):
if hasattr(os, "isatty"):