]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40275: test.support.check_impl_detail() uses sys.implementation (GH-20468)
authorVictor Stinner <vstinner@python.org>
Wed, 27 May 2020 22:44:23 +0000 (00:44 +0200)
committerGitHub <noreply@github.com>
Wed, 27 May 2020 22:44:23 +0000 (00:44 +0200)
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.

Lib/test/support/__init__.py

index e894545f87e4289b3bf5c697254cc3eae9fe628c..c958bae643a7176e94a6fe6ea0c0000a69714cef 100644 (file)
@@ -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):