WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit 63c2bdcf authored by Stefan Marr's avatar Stefan Marr
Browse files

Fix StringStream to conform to latest pypy

Signed-off-by: default avatarStefan Marr <git@stefan-marr.de>
parent 34e0614c
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:]
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment