diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-04-17 07:54:00 -0700 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2017-04-17 07:54:29 -0700 |
commit | 015e28eb3e0335cae66acc7d7d499f71c778a193 (patch) | |
tree | ffedfc1ec67d56831ca0031805fd9aafbf0e0524 /setup.py | |
parent | 3bb8c2f58cce5d738b860397ee98e216938df683 (diff) | |
download | dateutil-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.py | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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", |