Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e51529d7
Commit
e51529d7
authored
Mar 22, 2003
by
Kurt B. Kaiser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error message handling.
parent
df5126df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
Lib/idlelib/rpc.py
Lib/idlelib/rpc.py
+21
-3
No files found.
Lib/idlelib/rpc.py
View file @
e51529d7
...
...
@@ -87,13 +87,31 @@ class RPCServer(SocketServer.TCPServer):
return
self
.
socket
,
self
.
server_address
def
handle_error
(
self
,
request
,
client_address
):
"""Override TCPServer method, no error message if exiting"""
"""Override TCPServer method
Error message goes to __stderr__. No error message if exiting
normally or socket raised EOF. Other exceptions not handled in
server code will cause os._exit.
"""
try
:
raise
except
SystemExit
:
raise
else
:
TCPServer
.
handle_error
(
request
,
client_address
)
except
EOFError
:
pass
except
:
erf
=
'sys.__stderr__'
print
>>
erf
,
'-'
*
40
print
>>
erf
,
'Unhandled server exception!'
print
>>
erf
,
'Thread: %s'
%
threading
.
currentThread
().
getName
()
print
>>
erf
,
'Client Address: '
,
address
print
>>
erf
,
'Request: '
,
repr
(
request
)
traceback
.
print_exc
(
file
=
erf
)
print
>>
erf
,
'
\
n
*** Unrecoverable, server exiting!'
print
>>
erf
,
'-'
*
40
import
os
os
.
_exit
objecttable
=
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment