Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stanfordnlp/stanza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bauer <horatio@gmail.com>2022-11-09 05:02:24 +0300
committerJohn Bauer <horatio@gmail.com>2022-11-09 07:49:49 +0300
commiteb46dda76a275d66ef5a23a2de35a7f4e84d6fbb (patch)
treeb9bb3868cce39ab97308f78f3129f016d863047a
parentc0d8fe9749c28e29ab341922b0920ff27f39e714 (diff)
BrokenPipeError is more appropriate - fits the errors that come out of subprocess when this happens
-rw-r--r--stanza/server/java_protobuf_requests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/stanza/server/java_protobuf_requests.py b/stanza/server/java_protobuf_requests.py
index 374e5266..ea308feb 100644
--- a/stanza/server/java_protobuf_requests.py
+++ b/stanza/server/java_protobuf_requests.py
@@ -192,7 +192,7 @@ class JavaProtobufContext(object):
self.pipe.stdin.flush()
response_length = self.pipe.stdout.read(4)
if len(response_length) < 4:
- raise RuntimeError("Could not communicate with java process!")
+ raise BrokenPipeError("Could not communicate with java process!")
response_length = int.from_bytes(response_length, "big")
response_text = self.pipe.stdout.read(response_length)
response = self.build_response()