mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
#10695: use %s not %d so that a string 'port' does not cause a debug traceback
Passing the port as a string value works fine in regular mode, but if you turned debug on it would throw an error trying to print the port number, which is surprising and confusing.
This commit is contained in:
parent
8edd99d085
commit
32ef70c827
3 changed files with 14 additions and 1 deletions
|
@ -236,7 +236,7 @@ class Telnet:
|
|||
|
||||
"""
|
||||
if self.debuglevel > 0:
|
||||
print('Telnet(%s,%d):' % (self.host, self.port), end=' ')
|
||||
print('Telnet(%s,%s):' % (self.host, self.port), end=' ')
|
||||
if args:
|
||||
print(msg % args)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue