[or-cvs] r17102: {updater} tolerate the 2.4 getpass(), which can't be told which stream (updater/trunk/lib/thandy)

arma at seul.org arma at seul.org
Tue Oct 14 20:53:58 UTC 2008


Author: arma
Date: 2008-10-14 16:53:58 -0400 (Tue, 14 Oct 2008)
New Revision: 17102

Modified:
   updater/trunk/lib/thandy/keys.py
Log:
tolerate the 2.4 getpass(), which can't be told which stream
to write on.


Modified: updater/trunk/lib/thandy/keys.py
===================================================================
--- updater/trunk/lib/thandy/keys.py	2008-10-14 20:53:18 UTC (rev 17101)
+++ updater/trunk/lib/thandy/keys.py	2008-10-14 20:53:58 UTC (rev 17102)
@@ -354,11 +354,13 @@
         if self._passwd != None:
             return self._passwd
         while 1:
-            pwd = getpass.getpass("Password: ", sys.stderr)
+            sys.stderr.write("Password: ")
+            pwd = getpass.getpass("")
             if not reprompt:
                 return pwd
 
-            pwd2 = getpass.getpass("Confirm: ", sys.stderr)
+            sys.stderr.write("Confirm: ")
+            pwd2 = getpass.getpass("")
             if pwd == pwd2:
                 return pwd
             else:



More information about the tor-commits mailing list