Skip to content

Commit

Permalink
Python cleanup
Browse files Browse the repository at this point in the history
- Use sys.exit(...) instead of exit(...)
- Changed bitrpc.py's raw_input to getpass for passwords to conceal characters during command line input.
  • Loading branch information
barton2526 committed Aug 4, 2021
1 parent b3926ec commit 4361638
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions contrib/wallettools/walletchangepass.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from jsonrpc import ServiceProxy
import getpass
access = ServiceProxy("http://127.0.0.1:8332")
pwd = raw_input("Enter old wallet passphrase: ")
pwd2 = raw_input("Enter new wallet passphrase: ")
access.walletpassphrasechange(pwd, pwd2)
pwd = getpass.getpass(prompt="Enter old wallet passphrase: ")
pwd2 = getpass.getpass(prompt="Enter new wallet passphrase: ")
access.walletpassphrasechange(pwd, pwd2)
5 changes: 3 additions & 2 deletions contrib/wallettools/walletunlock.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from jsonrpc import ServiceProxy
import getpass
access = ServiceProxy("http://127.0.0.1:8332")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
pwd = getpass.getpass(prompt="Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
2 changes: 1 addition & 1 deletion share/qt/extract_strings_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def parse_po(text):
if not XGETTEXT:
print('Cannot extract strings: xgettext utility is not installed or not configured.',file=sys.stderr)
print('Please install package "gettext" and re-run \'./configure\'.',file=sys.stderr)
exit(1)
sys.exit(1)
child = Popen([XGETTEXT,'--output=-','-n','--keyword=_'] + files, stdout=PIPE)
(out, err) = child.communicate()

Expand Down

0 comments on commit 4361638

Please sign in to comment.