diff options
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -1,24 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import with_statement from setuptools import setup, find_packages def get_version(): - f = open('pep8.py') - try: + with open('pep8.py') as f: for line in f: if line.startswith('__version__'): return eval(line.split('=')[-1]) - finally: - f.close() def get_long_description(): descr = [] for fname in 'README.rst', 'CHANGES.txt': # , 'TODO.txt' - f = open(fname) - try: + with open(fname) as f: descr.append(f.read()) - finally: - f.close() return '\n\n'.join(descr) |