aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2017-04-17 07:54:00 -0700
committerJon Dufresne <jon.dufresne@gmail.com>2017-04-17 07:54:29 -0700
commit015e28eb3e0335cae66acc7d7d499f71c778a193 (patch)
treeffedfc1ec67d56831ca0031805fd9aafbf0e0524 /setup.py
parent3bb8c2f58cce5d738b860397ee98e216938df683 (diff)
downloaddateutil-015e28eb3e0335cae66acc7d7d499f71c778a193.tar.gz
Fix unclosed file warning in setup.py
With warnings turned on, appears as: setup.py:17: ResourceWarning: unclosed file <_io.BufferedReader name='./dateutil/__init__.py'>
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 46c0bc7..38f8f45 100644
--- a/setup.py
+++ b/setup.py
@@ -12,9 +12,8 @@ if isfile("MANIFEST"):
TOPDIR = os.path.dirname(__file__) or "."
-VERSION = re.search('__version__ = "([^"]+)"',
- codecs.open(TOPDIR + "/dateutil/__init__.py",
- encoding='utf-8').read()).group(1)
+with codecs.open(TOPDIR + "/dateutil/__init__.py", encoding='utf-8') as f:
+ VERSION = re.search('__version__ = "([^"]+)"', f.read()).group(1)
setup(name="python-dateutil",