Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1de05e9b
Commit
1de05e9b
authored
Jan 31, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check the errno in bad fd cases
parent
b3619be9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Lib/test/test_os.py
Lib/test/test_os.py
+8
-2
No files found.
Lib/test/test_os.py
View file @
1de05e9b
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
# portable than they had been thought to be.
# portable than they had been thought to be.
import
os
import
os
import
errno
import
unittest
import
unittest
import
warnings
import
warnings
import
sys
import
sys
...
@@ -249,7 +250,6 @@ class StatAttributeTests(unittest.TestCase):
...
@@ -249,7 +250,6 @@ class StatAttributeTests(unittest.TestCase):
result
=
os
.
statvfs
(
self
.
fname
)
result
=
os
.
statvfs
(
self
.
fname
)
except
OSError
,
e
:
except
OSError
,
e
:
# On AtheOS, glibc always returns ENOSYS
# On AtheOS, glibc always returns ENOSYS
import
errno
if
e
.
errno
==
errno
.
ENOSYS
:
if
e
.
errno
==
errno
.
ENOSYS
:
return
return
...
@@ -549,7 +549,13 @@ class TestInvalidFD(unittest.TestCase):
...
@@ -549,7 +549,13 @@ class TestInvalidFD(unittest.TestCase):
locals
()[
"test_"
+
f
]
=
get_single
(
f
)
locals
()[
"test_"
+
f
]
=
get_single
(
f
)
def
check
(
self
,
f
,
*
args
):
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
):
def
test_isatty
(
self
):
if
hasattr
(
os
,
"isatty"
):
if
hasattr
(
os
,
"isatty"
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment