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
cf86b15a
Commit
cf86b15a
authored
Nov 19, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20604: Added missed invalid mode in error message of socket.makefile().
Based on patch by Franck Michea.
parent
4f879d4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
Lib/socket.py
Lib/socket.py
+2
-3
No files found.
Lib/socket.py
View file @
cf86b15a
...
...
@@ -201,9 +201,8 @@ class socket(_socket.socket):
except the only mode characters supported are 'r', 'w' and 'b'.
The semantics are similar too. (XXX refactor to share code?)
"""
for
c
in
mode
:
if
c
not
in
{
"r"
,
"w"
,
"b"
}:
raise
ValueError
(
"invalid mode %r (only r, w, b allowed)"
)
if
not
set
(
mode
)
<=
{
"r"
,
"w"
,
"b"
}:
raise
ValueError
(
"invalid mode %r (only r, w, b allowed)"
%
(
mode
,))
writing
=
"w"
in
mode
reading
=
"r"
in
mode
or
not
writing
assert
reading
or
writing
...
...
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