- improved xreadlines (now a generator)
- version for release
diff --git a/pyserial/CHANGES.txt b/pyserial/CHANGES.txt
index 5b54653..6706f70 100644
--- a/pyserial/CHANGES.txt
+++ b/pyserial/CHANGES.txt
@@ -377,6 +377,9 @@
   setting) to ``False``. This means ``rtscts=True`` enables hardware flow
   control on RTS/CTS but no longer also on DTR/DSR. This change mostly
   affects Win32 as on other platforms, that setting was ignored anyway.
+- Improved xreadlines, it is now a generator function that yields lines as they
+  are received (previously it called readlines which would only return all
+  lines read after a read-timeout).
 
 Bugfixes:
 
diff --git a/pyserial/serial/__init__.py b/pyserial/serial/__init__.py
index d46e717..2c49007 100644
--- a/pyserial/serial/__init__.py
+++ b/pyserial/serial/__init__.py
@@ -6,7 +6,7 @@
 # (C) 2001-2010 Chris Liechti <cliechti@gmx.net>
 # this is distributed under a free software license, see license.txt
 
-VERSION = '2.5-rc2'
+VERSION = '2.5'
 
 import sys
 
diff --git a/pyserial/serial/serialutil.py b/pyserial/serial/serialutil.py
index a6a716d..7654fdf 100644
--- a/pyserial/serial/serialutil.py
+++ b/pyserial/serial/serialutil.py
@@ -440,7 +440,7 @@
 
     def readline(self, size=None, eol='\n'):
         """read a line which is terminated with end-of-line (eol) character
-        ('\n' by default) or until timeout"""
+        ('\n' by default) or until timeout."""
         line = bytearray()
         while 1:
             c = self.read(1)
@@ -455,8 +455,8 @@
         return bytes(line)
 
     def readlines(self, sizehint=None, eol='\n'):
-        """read a list of lines, until timeout
-        sizehint is ignored"""
+        """read a list of lines, until timeout.
+        sizehint is ignored."""
         if self.timeout is None:
             raise ValueError("Serial port MUST have enabled timeout for this function!")
         lines = []
@@ -471,8 +471,12 @@
         return lines
 
     def xreadlines(self, sizehint=None):
-        """just call readlines - here for compatibility"""
-        return self.readlines()
+        """Read lines, implemented as generator. It will raise StopIteration on
+        timeout (empty read). sizehint is ignored."""
+        while True:
+            line = self.readline()
+            if not line: break
+            yield line
 
     #  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
     # compatibility with io library