From e2e4d180f925a07fca32bdcbb6ff981455d9fb3f Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 8 Nov 2016 17:54:23 -0800 Subject: [PATCH] Close file in setup.py after finished reading Fixes a "ResourceWarning: unclosed file" during tests. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1275f4fd1..0f4d5fb38 100644 --- a/setup.py +++ b/setup.py @@ -100,7 +100,8 @@ def _lib_include(root): def _read(file): - return open(file, 'rb').read() + with open(file, 'rb') as fp: + return fp.read() try: