changeset 9:d5970cf6367d

Add a read function to close file descriptor after the file has been read
author Björn Ricks <bjoern.ricks@intevation.de>
date Fri, 26 Sep 2014 20:15:36 +0200
parents d9e733b87c29
children e41682c4bf7e
files setup.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Fri Sep 26 20:14:57 2014 +0200
+++ b/setup.py	Fri Sep 26 20:15:36 2014 +0200
@@ -4,11 +4,15 @@
 
 version = '0.1'
 
+def read(filename):
+    with open(filename, "r") as f:
+        return f.read()
+
 setup(
     name='odfcast',
     version=version,
     description="A conversion http service based on py3o",
-    long_description=open("README.rst").read(),
+    long_description=read("README.rst"),
     classifiers=[
         "Development Status :: 3 - Alpha",
         "Operating System :: POSIX :: Linux",
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)