Skip to content

Commit

Permalink
[3.12] pythongh-111881: Use lazy import in test.support (python#111885)…
Browse files Browse the repository at this point in the history
… (python#111890)

pythongh-111881: Use lazy import in test.support (python#111885)

* Import lazily getpass in test.support

Backport to 3.11: test.support.os_helper is unchanged.

(cherry picked from commit 0372e3b)
(cherry picked from commit e983ca8)
  • Loading branch information
vstinner committed Nov 9, 2023
1 parent 63205e5 commit 8123637
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import contextlib
import dataclasses
import functools
import getpass
import os
import re
import stat
Expand Down Expand Up @@ -380,6 +379,7 @@ def wrapper(*args, **kw):

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:
Expand Down

0 comments on commit 8123637

Please sign in to comment.