cpython: a5cb10f2dbaa (original) (raw)
Mercurial > cpython
changeset 91860:a5cb10f2dbaa 2.7
Issue #21990: Cleanup unnecessary inner class definition in saxutils. [#21990]
Raymond Hettinger python@rcn.com | |
---|---|
date | Fri, 25 Jul 2014 10:26:36 -0700 |
parents | f7c84674bdec |
children | cb2e1b3a395f |
files | Lib/xml/sax/saxutils.py Misc/NEWS |
diffstat | 2 files changed, 11 insertions(+), 5 deletions(-)[+] [-] Lib/xml/sax/saxutils.py 13 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Lib/xml/sax/saxutils.py +++ b/Lib/xml/sax/saxutils.py @@ -98,14 +98,17 @@ def _gettextwriter(out, encoding): except AttributeError: pass # wrap a binary writer with TextIOWrapper
- class UnbufferedTextIOWrapper(io.TextIOWrapper):
def write(self, s):[](#l1.8)
super(UnbufferedTextIOWrapper, self).write(s)[](#l1.9)
self.flush()[](#l1.10)
- return UnbufferedTextIOWrapper(buffer, encoding=encoding,
- return _UnbufferedTextIOWrapper(buffer, encoding=encoding, errors='xmlcharrefreplace', newline='\n')
+ +class _UnbufferedTextIOWrapper(io.TextIOWrapper):
+ + class XMLGenerator(handler.ContentHandler): def init(self, out=None, encoding="iso-8859-1"):
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -17,6 +17,9 @@ Library socket.error() exceptions with blocking I/O errors: EAGAIN, EALREADY, EINPROGRESS, or EWOULDBLOCK. +- Issue #21990: Clean-up unnecessary and slow inner class definition in