[Python-checkins] bpo-40275: test.support.check_impl_detail() uses sys.implementation (GH-20468)

Victor Stinner webhook-mailer at python.org
Wed May 27 18:44:30 EDT 2020


https://github.com/python/cpython/commit/b0461e19b5ecb2d89917b23efb5ce1048fab1b22
commit: b0461e19b5ecb2d89917b23efb5ce1048fab1b22
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2020-05-28T00:44:23+02:00
summary:

bpo-40275: test.support.check_impl_detail() uses sys.implementation (GH-20468)

check_impl_detail() of test.support now uses sys.implementation.name,
instead of platform.python_implementation().lower(). This change
prepares test.support to import the platform module lazily.

files:
M Lib/test/support/__init__.py

diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index e894545f87e42..c958bae643a71 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -1740,7 +1740,7 @@ def check_impl_detail(**guards):
           if check_impl_detail(cpython=False):  # everywhere except on CPython
     """
     guards, default = _parse_guards(guards)
-    return guards.get(platform.python_implementation().lower(), default)
+    return guards.get(sys.implementation.name, default)
 
 
 def no_tracing(func):



More information about the Python-checkins mailing list