Skip to content

Commit eb9e742

Browse files
author
Julien Castets
committed
Remove ResourceWarning in setup.py when getting the long description
1 parent 2b476cf commit eb9e742

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# file except in compliance with the License. You may obtain a copy of the
1010
# License at http://opensource.org/licenses/BSD-2-Clause
1111

12+
from contextlib import closing
1213
import os
1314
import re
1415

@@ -33,7 +34,8 @@ def get_version():
3334
def get_long_description():
3435
readme = os.path.join(os.path.dirname(__file__), 'README.rst')
3536
changes = os.path.join(os.path.dirname(__file__), 'CHANGES.rst')
36-
return open(readme).read() + '\n' + open(changes).read()
37+
with closing(open(readme)) as hreadme, closing(open(changes)) as hchanges:
38+
return hreadme.read() + '\n' + hchanges.read()
3739

3840

3941
setup(

0 commit comments

Comments
 (0)