From 48109b1bb512d8a1373c81cb1bae24f9f7014822 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 14 Aug 2019 16:06:43 +0200 Subject: [PATCH] Don't append 'm' ABI flag in Python 3.8 --- news/6885.bugfix | 1 + src/pip/_internal/pep425tags.py | 4 +++- tests/unit/test_pep425tags.py | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 news/6885.bugfix diff --git a/news/6885.bugfix b/news/6885.bugfix new file mode 100644 index 00000000000..1eedfec9376 --- /dev/null +++ b/news/6885.bugfix @@ -0,0 +1 @@ +Fix 'm' flag erroneously being appended to ABI tag in Python 3.8 on platforms that do not provide SOABI diff --git a/src/pip/_internal/pep425tags.py b/src/pip/_internal/pep425tags.py index 03a906b94bc..dc4fdcc3add 100644 --- a/src/pip/_internal/pep425tags.py +++ b/src/pip/_internal/pep425tags.py @@ -117,7 +117,9 @@ def get_abi_tag(): d = 'd' if get_flag('WITH_PYMALLOC', lambda: impl == 'cp', - warn=(impl == 'cp')): + warn=(impl == 'cp' and + sys.version_info < (3, 8))) \ + and sys.version_info < (3, 8): m = 'm' if get_flag('Py_UNICODE_SIZE', lambda: sys.maxunicode == 0x10ffff, diff --git a/tests/unit/test_pep425tags.py b/tests/unit/test_pep425tags.py index f570de62133..a18f525a98f 100644 --- a/tests/unit/test_pep425tags.py +++ b/tests/unit/test_pep425tags.py @@ -47,6 +47,10 @@ def abi_tag_unicode(self, flags, config_vars): base = pip._internal.pep425tags.get_abbr_impl() + \ pip._internal.pep425tags.get_impl_ver() + if sys.version_info >= (3, 8): + # Python 3.8 removes the m flag, so don't look for it. + flags = flags.replace('m', '') + if sys.version_info < (3, 3): config_vars.update({'Py_UNICODE_SIZE': 2}) mock_gcf = self.mock_get_config_var(**config_vars)