From eba309a9354347f0824f3f9a82e462ef243e11ff Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Sat, 14 Mar 2020 12:02:50 +0530 Subject: Remove deprecated U mode in open for Python 3.9 compatibility. --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 09b1c89..d91ffce 100644 --- a/setup.py +++ b/setup.py @@ -164,7 +164,13 @@ def find_make(alt=('gmake', 'gnumake', 'make', 'nmake')): return make -long_description = open(os.path.join(BASE_PATH, 'README.rst'), 'U').read() +if six.PY2: + with open(os.path.join(BASE_PATH, 'README.rst'), 'U') as f: + long_description = f.read() +else: + with open(os.path.join(BASE_PATH, 'README.rst')) as f: + long_description = f.read() + distmeta = open(PYCP('distmeta.h')).read().strip().splitlines() distmeta = [item.split('\"')[1] for item in distmeta] version = distmeta[0].strip() -- cgit v1.2.1