From 96b528bcb09af8e561ae4e4772235c5338f67d6c Mon Sep 17 00:00:00 2001 From: Demian Brecht Date: Tue, 5 Nov 2019 15:46:15 -0800 Subject: [PATCH] fix unclosed version file warning --- python_http_client/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python_http_client/__init__.py b/python_http_client/__init__.py index 0d88104..8982521 100644 --- a/python_http_client/__init__.py +++ b/python_http_client/__init__.py @@ -19,4 +19,5 @@ dir_path = os.path.dirname(os.path.realpath(__file__)) if os.path.isfile(os.path.join(dir_path, 'VERSION.txt')): - __version__ = open(os.path.join(dir_path, 'VERSION.txt')).read().strip() + with open(os.path.join(dir_path, 'VERSION.txt')) as fh: + __version__ = fh.read().strip()