diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2023-10-04 05:09:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 05:09:43 (GMT) |
commit | bfe7e72522565f828f43c2591fea84a7981ee048 (patch) | |
tree | c1602e78494734ac325d395f51a74fe55bb8d5c7 /Lib/getpass.py | |
parent | f02f26e29366513b097578fbc6b25e02d0eba7c0 (diff) | |
download | cpython-bfe7e72522565f828f43c2591fea84a7981ee048.zip cpython-bfe7e72522565f828f43c2591fea84a7981ee048.tar.gz cpython-bfe7e72522565f828f43c2591fea84a7981ee048.tar.bz2 |
gh-109653: Defer importing `warnings` in several modules (#110286)
Diffstat (limited to 'Lib/getpass.py')
-rw-r--r-- | Lib/getpass.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/getpass.py b/Lib/getpass.py index 6970d8a..8b42c0a 100644 --- a/Lib/getpass.py +++ b/Lib/getpass.py @@ -18,7 +18,6 @@ import contextlib import io import os import sys -import warnings __all__ = ["getpass","getuser","GetPassWarning"] @@ -118,6 +117,7 @@ def win_getpass(prompt='Password: ', stream=None): def fallback_getpass(prompt='Password: ', stream=None): + import warnings warnings.warn("Can not control echo on the terminal.", GetPassWarning, stacklevel=2) if not stream: |