Changeset 4988:262e83de0c2a in livinglogic.python.xist

Show
Ignore:
Timestamp:
09/19/12 15:45:25 (6 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Raise EOFError when ul4on.Decoder can't read from the stream.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • NEWS.rst

    r4986 r4988  
    1010*   Java conversion of :class:`ll.ul4c.And` has been fixed to evaluate the second 
    1111    operand only when the result isn't clear from the first. 
     12 
     13*   :class:`ll.ul4on.Decoder` now raises an ``EOFError`` when reading from an 
     14    empty stream. 
    1215 
    1316 
  • src/ll/ul4on.py

    r4924 r4988  
    253253        if typecode is None: 
    254254            typecode = self.stream.read(1) 
    255         if typecode == "^": 
     255        if not typecode: 
     256            raise EOFError() 
     257        elif typecode == "^": 
    256258            position = self._readint() 
    257259            return self._objects[position]