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
21f93aa3
Commit
21f93aa3
authored
Dec 05, 2010
by
Hirokazu Yamamoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Should use posix_error here.
parent
89213cb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
Lib/test/test_ntpath.py
Lib/test/test_ntpath.py
+1
-1
Modules/posixmodule.c
Modules/posixmodule.c
+3
-5
No files found.
Lib/test/test_ntpath.py
View file @
21f93aa3
...
...
@@ -248,7 +248,7 @@ class TestNtpath(unittest.TestCase):
self.assertFalse(ntpath.sameopenfile(tf1.fileno(), tf2.fileno()))
# Make sure invalid values don'
t
cause
issues
on
win32
if
sys
.
platform
==
"win32"
:
with
self
.
assertRaises
(
Value
Error
):
with
self
.
assertRaises
(
OS
Error
):
# Invalid file descriptors shouldn't display assert
# dialogs (#4804)
ntpath
.
sameopenfile
(
-
1
,
-
1
)
...
...
Modules/posixmodule.c
View file @
21f93aa3
...
...
@@ -2803,14 +2803,12 @@ posix__getfileinformation(PyObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"i:_getfileinformation"
,
&
fd
))
return
NULL
;
if
(
!
_PyVerify_fd
(
fd
))
{
PyErr_SetString
(
PyExc_ValueError
,
"received invalid file descriptor"
);
return
NULL
;
}
if
(
!
_PyVerify_fd
(
fd
))
return
posix_error
();
hFile
=
(
HANDLE
)
_get_osfhandle
(
fd
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
win32_error
(
"_getfileinformation"
,
NULL
);
return
posix_error
(
);
if
(
!
GetFileInformationByHandle
(
hFile
,
&
info
))
return
win32_error
(
"_getfileinformation"
,
NULL
);
...
...
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