@@ -456,12 +456,6 @@ def supported(self):
456456 status = - 1
457457 return status
458458
459- def _getpass (self , * args , ** kwargs ):
460- """Wrap getpass.getpass(), so that we can override it when testing.
461- """
462-
463- return getpass .getpass (* args , ** kwargs )
464-
465459 @properties .NonDataProperty
466460 def keyring_key (self ):
467461 # _unlock or _init_file will set the key or raise an exception
@@ -470,9 +464,9 @@ def keyring_key(self):
470464
471465 def _get_new_password (self ):
472466 while True :
473- password = self . _getpass (
467+ password = getpass . getpass (
474468 "Please set a password for your new keyring: " )
475- confirm = self . _getpass ('Please confirm the password: ' )
469+ confirm = getpass . getpass ('Please confirm the password: ' )
476470 if password != confirm :
477471 sys .stderr .write ("Error: Your passwords didn't match\n " )
478472 continue
@@ -515,7 +509,7 @@ def _unlock(self):
515509 Unlock this keyring by getting the password for the keyring from the
516510 user.
517511 """
518- self .keyring_key = self . _getpass (
512+ self .keyring_key = getpass . getpass (
519513 'Please enter password for encrypted keyring: ' )
520514 try :
521515 ref_pw = self .get_password ('keyring-setting' , 'password reference' )
@@ -590,7 +584,7 @@ def __convert_0_9_1(self, keyring_password):
590584 IV = head [self .block_size :]
591585
592586 if keyring_password is None :
593- keyring_password = self . _getpass (
587+ keyring_password = getpass . getpass (
594588 "Please input your password for the keyring: " )
595589
596590 cipher = self ._create_cipher (keyring_password , salt , IV )
@@ -640,7 +634,7 @@ def __convert_0_9_0(self, keyring_password):
640634 import crypt
641635
642636 if keyring_password is None :
643- keyring_password = self . _getpass (
637+ keyring_password = getpass . getpass (
644638 "Please input your password for the keyring: " )
645639
646640 hashed = crypt .crypt (keyring_password , keyring_password )
0 commit comments