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
a2480921
Commit
a2480921
authored
Jul 25, 2012
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #7163: Propagate return value of sys.stdout.write.
Patch by Roger Serwy.
parent
514269f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
Lib/idlelib/NEWS.txt
Lib/idlelib/NEWS.txt
+2
-0
Lib/idlelib/OutputWindow.py
Lib/idlelib/OutputWindow.py
+1
-0
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+4
-3
No files found.
Lib/idlelib/NEWS.txt
View file @
a2480921
What's New in IDLE 3.2.4?
=========================
- Issue #7163: Propagate return value of sys.stdout.write.
- Issue #15318: Prevent writing to sys.stdin.
- Issue #13532, #15319: Check that arguments to sys.stdout.write are strings.
...
...
Lib/idlelib/OutputWindow.py
View file @
a2480921
...
...
@@ -40,6 +40,7 @@ class OutputWindow(EditorWindow):
self
.
text
.
insert
(
mark
,
s
,
tags
)
self
.
text
.
see
(
mark
)
self
.
text
.
update
()
return
len
(
s
)
def
writelines
(
self
,
lines
):
for
line
in
lines
:
...
...
Lib/idlelib/PyShell.py
View file @
a2480921
...
...
@@ -760,7 +760,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
def
write
(
self
,
s
):
"Override base class method"
self
.
tkconsole
.
stderr
.
write
(
s
)
return
self
.
tkconsole
.
stderr
.
write
(
s
)
def
display_port_binding_error
(
self
):
tkMessageBox
.
showerror
(
...
...
@@ -1229,7 +1229,7 @@ class PyShell(OutputWindow):
def write(self, s, tags=()):
try:
self.text.mark_gravity("iomark", "right")
OutputWindow.write(self, s, tags, "iomark")
count =
OutputWindow.write(self, s, tags, "iomark")
self.text.mark_gravity("iomark", "left")
except:
raise ###pass # ### 11Aug07 KBK if we are expecting exceptions
...
...
@@ -1238,6 +1238,7 @@ class PyShell(OutputWindow):
self
.
canceled
=
0
if
not
use_subprocess
:
raise
KeyboardInterrupt
return
count
class
PseudoFile
(
object
):
...
...
@@ -1249,7 +1250,7 @@ class PseudoFile(object):
def
write
(
self
,
s
):
if
not
isinstance
(
s
,
str
):
raise
TypeError
(
'must be str, not '
+
type
(
s
).
__name__
)
self
.
shell
.
write
(
s
,
self
.
tags
)
return
self
.
shell
.
write
(
s
,
self
.
tags
)
def
writelines
(
self
,
lines
):
for
line
in
lines
:
...
...
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