summaryrefslogtreecommitdiffstats
path: root/pgcli
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-22 06:36:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-22 06:36:54 +0000
commita2f57e22fe28c2106c586157fd8b1df5cb5d2fb7 (patch)
tree0e112f87ea6d4e21f0ce345ed8a2520c4cd4a355 /pgcli
parentAdding upstream version 3.3.0. (diff)
downloadpgcli-a2f57e22fe28c2106c586157fd8b1df5cb5d2fb7.tar.xz
pgcli-a2f57e22fe28c2106c586157fd8b1df5cb5d2fb7.zip
Adding upstream version 3.3.1.upstream/3.3.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pgcli')
-rw-r--r--pgcli/__init__.py2
-rw-r--r--pgcli/main.py21
2 files changed, 12 insertions, 11 deletions
diff --git a/pgcli/__init__.py b/pgcli/__init__.py
index 88c513e..ff04168 100644
--- a/pgcli/__init__.py
+++ b/pgcli/__init__.py
@@ -1 +1 @@
-__version__ = "3.3.0"
+__version__ = "3.3.1"
diff --git a/pgcli/main.py b/pgcli/main.py
index 5395f67..e4a2ee3 100644
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -549,6 +549,17 @@ class PGCli:
- uninstall keyring: pip uninstall keyring
- disable keyring in our configuration: add keyring = False to [main]"""
)
+
+ # Prompt for a password immediately if requested via the -W flag. This
+ # avoids wasting time trying to connect to the database and catching a
+ # no-password exception.
+ # If we successfully parsed a password from a URI, there's no need to
+ # prompt for it, even with the -W flag
+ if self.force_passwd_prompt and not passwd:
+ passwd = click.prompt(
+ "Password for %s" % user, hide_input=True, show_default=False, type=str
+ )
+
if not passwd and keyring:
try:
@@ -562,16 +573,6 @@ class PGCli:
fg="red",
)
- # Prompt for a password immediately if requested via the -W flag. This
- # avoids wasting time trying to connect to the database and catching a
- # no-password exception.
- # If we successfully parsed a password from a URI, there's no need to
- # prompt for it, even with the -W flag
- if self.force_passwd_prompt and not passwd:
- passwd = click.prompt(
- "Password for %s" % user, hide_input=True, show_default=False, type=str
- )
-
def should_ask_for_password(exc):
# Prompt for a password after 1st attempt to connect
# fails. Don't prompt if the -w flag is supplied