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
5e2c5fa1
Commit
5e2c5fa1
authored
May 30, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imp_load_module(): correct and comment the sense of the test for '+'
in the mode (it's forbidden).
parent
4ae6faed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
Python/import.c
Python/import.c
+7
-2
No files found.
Python/import.c
View file @
5e2c5fa1
...
...
@@ -2408,11 +2408,16 @@ imp_load_module(PyObject *self, PyObject *args)
&
name
,
&
fob
,
&
pathname
,
&
suffix
,
&
mode
,
&
type
))
return
NULL
;
if
(
*
mode
&&
!
(
*
mode
==
'r'
||
*
mode
==
'U'
||
strchr
(
mode
,
'+'
)))
{
if
(
*
mode
)
{
/* Mode must start with 'r' or 'U' and must not contain '+'.
Implicit in this test is the assumption that the mode
may contain other modifiers like 'b' or 't'. */
if
(
!
(
*
mode
==
'r'
||
*
mode
==
'U'
)
||
strchr
(
mode
,
'+'
))
{
PyErr_Format
(
PyExc_ValueError
,
"invalid file open mode %.200s"
,
mode
);
return
NULL
;
}
}
if
(
fob
==
Py_None
)
fp
=
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