From b3ce06bbf99b29d15d2e9d204a96f26ca96018b1 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Thu, 29 Apr 2010 19:46:43 +0200 Subject: [PATCH] add close method to DontReadFromInput so multiprocessing can close it --HG-- branch : trunk --- py/_io/capture.py | 2 ++ testing/io_/test_capture.py | 1 + 2 files changed, 3 insertions(+) diff --git a/py/_io/capture.py b/py/_io/capture.py index 093685e82..fe03dee9a 100644 --- a/py/_io/capture.py +++ b/py/_io/capture.py @@ -334,6 +334,8 @@ class DontReadFromInput: raise ValueError("redirected Stdin is pseudofile, has no fileno()") def isatty(self): return False + def close(self): + pass try: devnullpath = os.devnull diff --git a/testing/io_/test_capture.py b/testing/io_/test_capture.py index 7b03c4ae1..fa64208a0 100644 --- a/testing/io_/test_capture.py +++ b/testing/io_/test_capture.py @@ -66,6 +66,7 @@ def test_dontreadfrominput(): py.test.raises(IOError, f.readlines) py.test.raises(IOError, iter, f) py.test.raises(ValueError, f.fileno) + f.close() # just for completeness def pytest_funcarg__tmpfile(request): testdir = request.getfuncargvalue("testdir")