mirror of
https://github.com/python/cpython.git
synced 2025-10-09 00:22:17 +00:00
Improve the self-test code a bit: read a host from sys.argv[1] if set,
and list the host name when prompting for the password.
This commit is contained in:
parent
a119c0dd5e
commit
d659693b5b
1 changed files with 8 additions and 2 deletions
|
@ -781,9 +781,15 @@ def Time2Internaldate(date_time):
|
||||||
|
|
||||||
if __debug__ and __name__ == '__main__':
|
if __debug__ and __name__ == '__main__':
|
||||||
|
|
||||||
|
host = ''
|
||||||
|
import sys
|
||||||
|
if sys.argv[1:]:
|
||||||
|
host = sys.argv[1]
|
||||||
|
|
||||||
import getpass
|
import getpass
|
||||||
USER = getpass.getuser()
|
USER = getpass.getuser()
|
||||||
PASSWD = getpass.getpass()
|
PASSWD = getpass.getpass(
|
||||||
|
"IMAP password for %s: " % (host or "localhost"))
|
||||||
|
|
||||||
test_seq1 = (
|
test_seq1 = (
|
||||||
('login', (USER, PASSWD)),
|
('login', (USER, PASSWD)),
|
||||||
|
@ -815,7 +821,7 @@ if __debug__ and __name__ == '__main__':
|
||||||
return dat
|
return dat
|
||||||
|
|
||||||
Debug = 4
|
Debug = 4
|
||||||
M = IMAP4()
|
M = IMAP4(host)
|
||||||
print 'PROTOCOL_VERSION = %s' % M.PROTOCOL_VERSION
|
print 'PROTOCOL_VERSION = %s' % M.PROTOCOL_VERSION
|
||||||
|
|
||||||
for cmd,args in test_seq1:
|
for cmd,args in test_seq1:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue