From 65b4405aa9ebfd689a88a6b92ea9b40816504e4a Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 21 Jan 2020 18:16:05 +0200 Subject: [PATCH] U flag deprecated since Python 3.3 and removed in 3.9 --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9bea257..7f3a901 100644 --- a/setup.py +++ b/setup.py @@ -95,9 +95,11 @@ def append_env(L, e): s.write(line + "\n") sys.exit(0) -with open("README.rst", "U", encoding="utf-8") as r: +mode = "r" if sys.version_info >= (3, 3) else "U" + +with open("README.rst", mode, encoding="utf-8") as r: readme_text = r.read() -with open("src/pylibmc-version.h", "U", encoding="utf-8") as r: +with open("src/pylibmc-version.h", mode, encoding="utf-8") as r: version = r.read().strip().split("\"")[1] setup(