Removing unused function in test_png
@@ -64,31 +64,6 @@ def topngbytes(name, rows, x, y, **k):
return f.getvalue()
-def redirect_io(inp, out, f):
- """Calls the function `f` with ``sys.stdin`` changed to `inp`
- and ``sys.stdout`` changed to `out`. They are restored when `f`
- returns. This function returns whatever `f` returns.
- """
-
- import os
- import sys
-
- oldin, sys.stdin = sys.stdin, inp
- oldout, sys.stdout = sys.stdout, out
- try:
- x = f()
- finally:
- sys.stdin = oldin
- sys.stdout = oldout
- if os.environ.get('PYPNG_TEST_TMP') and hasattr(out, 'getvalue'):
- name = mycallersname()
- if name:
- w = open(name + '.png', 'wb')
- w.write(out.getvalue())
- w.close()
- return x
-
-
def mycallersname():
"""Returns the name of the caller of the caller of this function
(hence the name of the caller of the function in which
