1. Pypy
  2. Untitled project
  3. pypy


Armin Rigo  committed ace3f01

Move the class declaration outside the function. There is no
reason to have a local class: it doesn't depend on anything.
This fixes issue #1818.

  • Participants
  • Parent commits 6743839
  • Branches default

Comments (0)

Files changed (1)

File lib-python/2.7/xml/sax/saxutils.py

View file
  • Ignore whitespace
         except AttributeError:
     # wrap a binary writer with TextIOWrapper
-    class UnbufferedTextIOWrapper(io.TextIOWrapper):
-        def write(self, s):
-            super(UnbufferedTextIOWrapper, self).write(s)
-            self.flush()
-    return UnbufferedTextIOWrapper(buffer, encoding=encoding,
+    return _UnbufferedTextIOWrapper(buffer, encoding=encoding,
+# PyPy: moved this class outside the function above
+class _UnbufferedTextIOWrapper(io.TextIOWrapper):
+    def write(self, s):
+        super(_UnbufferedTextIOWrapper, self).write(s)
+        self.flush()
 class XMLGenerator(handler.ContentHandler):