Commits

Anonymous committed 4919dee

Be nicer to systems that have neither termios nor msvcrt.

  • Participants
  • Parent commits e233396
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Lib/getpass.py

 	try:
 		import termios, TERMIOS
 	except ImportError:
-		return win_getpass(prompt)
+		try:
+			import msvcrt
+		except ImportError:
+			return default_getpass(prompt)
+		else:
+			return win_getpass(prompt)
 
 	fd = sys.stdin.fileno()
 	old = termios.tcgetattr(fd)	# a copy to save
 	return pw
 
 
+def default_getpass(prompt='Password: '):
+	return raw_input(prompt)
+
+
 def getuser():
 	"""Get the username from the environment or password database.