You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by gi...@apache.org on 2020/12/29 13:09:18 UTC
[buildstream] 15/16: CASDProcessManager: expect return code 1 on
win32
This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch aevri/win32_receive_signals
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 7d0bff1ff0b9e32bf9555ed8b68f8e1caed677a2
Author: Angelos Evripiotis <je...@bloomberg.net>
AuthorDate: Tue Oct 15 13:08:34 2019 +0100
CASDProcessManager: expect return code 1 on win32
---
src/buildstream/_cas/casdprocessmanager.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/buildstream/_cas/casdprocessmanager.py b/src/buildstream/_cas/casdprocessmanager.py
index e83e128..fb6caf8 100644
--- a/src/buildstream/_cas/casdprocessmanager.py
+++ b/src/buildstream/_cas/casdprocessmanager.py
@@ -22,6 +22,7 @@ import os
import shutil
import signal
import subprocess
+import sys
import tempfile
import time
@@ -172,7 +173,15 @@ class CASDProcessManager:
)
return
- if return_code != 0 and messenger:
+ expected_return_code = 0
+ if sys.platform == "win32":
+ # Note that the return code is "1" on Windows by definition -
+ # `POpen.terminate()` calls `TerminateProcess()`, which specifies
+ # the return code for the process. Python specifies "1" as the
+ # return code.
+ expected_return_code = 1
+
+ if return_code != expected_return_code and messenger:
messenger.message(
Message(
MessageType.BUG,