From f108976ebbfe28bc5c9a62d95555c7adc396b82f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 9 Nov 2023 17:46:27 +0100 Subject: [PATCH] [3.11] gh-111881: Use lazy import in test.support (#111885) (#111890) (#111902) [3.12] gh-111881: Use lazy import in test.support (#111885) (#111890) gh-111881: Use lazy import in test.support (#111885) * Import lazily getpass in test.support Backport to 3.11: test.support.os_helper is unchanged. (cherry picked from commit 0372e3b02a7e3dc1c564dba94dcd817c5472b04f) (cherry picked from commit e983ca859de279682631dbb13b959f14a7d89a7b) --- Lib/test/support/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 7ebc42e5bdd0..dc7a6e6741b8 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -6,7 +6,6 @@ if __name__ != 'test.support': import contextlib import dataclasses import functools -import getpass import os import re import stat @@ -380,6 +379,7 @@ def requires_mac_ver(*min_version): def skip_if_buildbot(reason=None): """Decorator raising SkipTest if running on a buildbot.""" + import getpass if not reason: reason = 'not suitable for buildbots' try: -- 2.47.3