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
f8fc674f
Commit
f8fc674f
authored
Jul 09, 2012
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 13532: Allow bytearrays to be written also.
parent
9e6bf1a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+2
-2
Lib/idlelib/run.py
Lib/idlelib/run.py
+2
-2
No files found.
Lib/idlelib/PyShell.py
View file @
f8fc674f
...
...
@@ -1265,8 +1265,8 @@ class PseudoFile(object):
self.encoding = encoding
def write(self, s):
if not isinstance(s,
basestring
):
raise TypeError('
must
be
str
,
not
' + type(s).__name__)
if not isinstance(s,
(basestring, bytearray)
):
raise TypeError('
must
be
str
ing
,
not
' + type(s).__name__)
self.shell.write(s, self.tags)
def writelines(self, lines):
...
...
Lib/idlelib/run.py
View file @
f8fc674f
...
...
@@ -263,8 +263,8 @@ class _RPCFile(io.TextIOBase):
return
setattr
(
self
.
rpc
,
name
,
value
)
def
write
(
self
,
s
):
if
not
isinstance
(
s
,
basestring
):
raise
TypeError
(
'must be str, not '
+
type
(
s
).
__name__
)
if
not
isinstance
(
s
,
(
basestring
,
bytearray
)
):
raise
TypeError
(
'must be str
ing
, not '
+
type
(
s
).
__name__
)
return
self
.
rpc
.
write
(
s
)
class
MyHandler
(
rpc
.
RPCHandler
):
...
...
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