mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-109653: Defer importing warnings
in several modules (#110286)
This commit is contained in:
parent
f02f26e293
commit
bfe7e72522
6 changed files with 10 additions and 6 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue