File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed
sphinxcontrib/confluencebuilder Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 33
44from __future__ import annotations
55from contextlib import contextmanager
6+ from contextlib import suppress
67from pathlib import Path
78from sphinxcontrib .confluencebuilder .std .confluence import API_REST_V1
89from sphinxcontrib .confluencebuilder .std .confluence import API_REST_V2
910from sphinxcontrib .confluencebuilder .std .confluence import FONT_SIZE
1011from sphinxcontrib .confluencebuilder .std .confluence import FONT_X_HEIGHT
12+ from subprocess import check_call
1113from hashlib import sha256
1214from urllib .parse import urlparse
1315import getpass
1416import os
1517import re
1618import shutil
17- import subprocess
1819import tempfile
1920import unicodedata
2021
@@ -334,13 +335,23 @@ def getpass2(prompt='Password: '):
334335 # disable this feature.
335336 if (os .name == 'nt' and 'MSYSTEM' in os .environ and 'TERM' in os .environ and
336337 'CONFLUENCEBUILDER_NO_GETPASS_HOOK' not in os .environ ):
337- subprocess .check_call (['/usr/bin/stty' , '-echo' ]) # noqa: S603
338338 try :
339- value = input (prompt )
340- finally :
341- subprocess .check_call (['/usr/bin/stty' , 'echo' ]) # noqa: S603
342- print ()
343- return value
339+ check_call (['/usr/bin/stty' , '-echo' ]) # noqa: S603
340+ except : # noqa: E722
341+ print ()
342+ print ()
343+ print ('(error) pass input not available; please run with winpty' )
344+ print ()
345+ return None
346+ else :
347+ try :
348+ value = input (prompt )
349+ finally :
350+ with suppress (Exception ):
351+ check_call (['/usr/bin/stty' , 'echo' ]) # noqa: S603
352+
353+ print ()
354+ return value
344355
345356 return getpass .getpass (prompt = prompt )
346357
You can’t perform that action at this time.
0 commit comments