Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb0b823

Browse files
committed
don't crash on interrupts: catch the interrupt and continue the handling loop
1 parentb4825a6 commitfb0b823

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎jsonrpc2_zeromq/server.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# information.
55

66
importthreading
7+
importerrno
78

89
importzmq
910

@@ -39,7 +40,13 @@ def stop(self):
3940
defrun(self):
4041
self.logger.info("^_^ Server now listening on %s",self.endpoint)
4142
whilenotself.should_stop:
42-
self._handle_one_message()
43+
try:
44+
self._handle_one_message()
45+
exceptzmq.ZMQErrorase:
46+
ife.errno==errno.EINTR:
47+
continue
48+
else:
49+
raise
4350

4451
def_handle_one_message(self):
4552
req=client_id=None

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp