Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bed1710

Browse files
committed
Fix more threading API related bugs: Thread.get_name() --> Thread.name.
Seen when setting RPCHandler.debugging=True
1 parent 47c2b60 commit bed1710

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

Lib/idlelib/rpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def handle_error(self, request, client_address):
106106
erf = sys.__stderr__
107107
print('\n' + '-'*40, file=erf)
108108
print('Unhandled server exception!', file=erf)
109-
print('Thread: %s' % threading.current_thread().get_name(), file=erf)
109+
print('Thread: %s' % threading.current_thread().name, file=erf)
110110
print('Client Address: ', client_address, file=erf)
111111
print('Request: ', repr(request), file=erf)
112112
traceback.print_exc(file=erf)
@@ -149,7 +149,7 @@ def exithook(self):
149149
def debug(self, *args):
150150
if not self.debugging:
151151
return
152-
s = self.location + " " + str(threading.current_thread().get_name())
152+
s = self.location + " " + str(threading.current_thread().name)
153153
for a in args:
154154
s = s + " " + str(a)
155155
print(s, file=sys.__stderr__)

Lib/idlelib/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def handle_error(self, request, client_address):
230230
erf = sys.__stderr__
231231
print('\n' + '-'*40, file=erf)
232232
print('Unhandled server exception!', file=erf)
233-
print('Thread: %s' % threading.current_thread().get_name(), file=erf)
233+
print('Thread: %s' % threading.current_thread().name, file=erf)
234234
print('Client Address: ', client_address, file=erf)
235235
print('Request: ', repr(request), file=erf)
236236
traceback.print_exc(file=erf)

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Core and Builtins
2424
Library
2525
-------
2626

27+
- IDLE would print a "Unhandled server exception!" message when internal
28+
debugging is enabled.
29+
2730
- Issue #4455: IDLE failed to display the windows list when two windows have
2831
the same title.
2932

0 commit comments

Comments
 (0)