Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x-RPySOM
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mu
x-RPySOM
Commits
63c2bdcf
Commit
63c2bdcf
authored
May 21, 2014
by
Stefan Marr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix StringStream to conform to latest pypy
Signed-off-by:
Stefan Marr
<
git@stefan-marr.de
>
parent
34e0614c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
string_stream.py
src/rlib/string_stream.py
+3
-6
No files found.
src/rlib/string_stream.py
View file @
63c2bdcf
from
rpython.rlib.streamio
import
Stream
,
StreamError
class
StringStream
(
Stream
):
def
__init__
(
self
,
string
):
self
.
_string
=
string
...
...
@@ -8,15 +9,10 @@ class StringStream(Stream):
def
write
(
self
,
data
):
raise
StreamError
(
"StringStream is not writable"
)
def
truncate
(
self
,
size
):
raise
StreamError
(
"StringStream is immutable"
)
def
peek
(
self
):
if
self
.
pos
<
self
.
max
:
return
self
.
_string
[
self
.
pos
:]
else
:
return
''
def
tell
(
self
):
return
self
.
pos
...
...
@@ -33,6 +29,7 @@ class StringStream(Stream):
def
read
(
self
,
n
):
assert
isinstance
(
n
,
int
)
end
=
self
.
pos
+
n
assert
end
>=
0
data
=
self
.
_string
[
self
.
pos
:
end
]
self
.
pos
+=
len
(
data
)
return
data
\ No newline at end of file
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