diff options
author | cpopa <devnull@localhost> | 2013-09-05 11:23:39 +0300 |
---|---|---|
committer | cpopa <devnull@localhost> | 2013-09-05 11:23:39 +0300 |
commit | 7bb05cb3ae87f834c5a6864f38c20c4f544dcb8a (patch) | |
tree | 3b2cb460c558f80a05e7f5e1b06e04a37ebe9733 | |
parent | e794dcc35b0e39c1a86305d383e75d183cd8164a (diff) | |
download | pylint-7bb05cb3ae87f834c5a6864f38c20c4f544dcb8a.tar.gz |
Write to the same fd.
-rw-r--r-- | test/test_misc.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/test_misc.py b/test/test_misc.py index b903161..ff6815d 100644 --- a/test/test_misc.py +++ b/test/test_misc.py @@ -28,15 +28,14 @@ from pylint.testutils import CheckerTestCase, Message @contextlib.contextmanager def create_file_backed_module(code): fd, tmp = tempfile.mkstemp() - os.close(fd) - with open(tmp, 'w') as stream: - stream.write(code) + os.write(fd, code) try: module = test_utils.build_module(code) module.file = tmp yield module finally: + os.close(fd) os.remove(tmp) |