File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 3
3
# portable than they had been thought to be.
4
4
5
5
import os
6
+ import errno
6
7
import unittest
7
8
import warnings
8
9
import sys
@@ -249,7 +250,6 @@ def test_statvfs_attributes(self):
249
250
result = os .statvfs (self .fname )
250
251
except OSError , e :
251
252
# On AtheOS, glibc always returns ENOSYS
252
- import errno
253
253
if e .errno == errno .ENOSYS :
254
254
return
255
255
@@ -549,7 +549,13 @@ def helper(self):
549
549
locals ()["test_" + f ] = get_single (f )
550
550
551
551
def check (self , f , * args ):
552
- self .assertRaises (OSError , f , test_support .make_bad_fd (), * args )
552
+ try :
553
+ f (test_support .make_bad_fd (), * args )
554
+ except OSError as e :
555
+ self .assertEqual (e .errno , errno .EBADF )
556
+ else :
557
+ self .fail ("%r didn't raise a OSError with a bad file descriptor"
558
+ % f )
553
559
554
560
def test_isatty (self ):
555
561
if hasattr (os , "isatty" ):
You can’t perform that action at this time.
0 commit comments