Skip to content

Commit eba309a

Browse files
tirkarthiauvipy
authored andcommitted
Remove deprecated U mode in open for Python 3.9 compatibility.
1 parent 1286c48 commit eba309a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,13 @@ def find_make(alt=('gmake', 'gnumake', 'make', 'nmake')):
164164
return make
165165

166166

167-
long_description = open(os.path.join(BASE_PATH, 'README.rst'), 'U').read()
167+
if six.PY2:
168+
with open(os.path.join(BASE_PATH, 'README.rst'), 'U') as f:
169+
long_description = f.read()
170+
else:
171+
with open(os.path.join(BASE_PATH, 'README.rst')) as f:
172+
long_description = f.read()
173+
168174
distmeta = open(PYCP('distmeta.h')).read().strip().splitlines()
169175
distmeta = [item.split('\"')[1] for item in distmeta]
170176
version = distmeta[0].strip()

0 commit comments

Comments
 (0)