Skip to content

Commit

Permalink
Revert Handle errors in python subprocess cmd.Start() (#30264)
Browse files Browse the repository at this point in the history
(cherry picked from commit 463727b)
  • Loading branch information
gh123man authored and github-actions[bot] committed Oct 18, 2024
1 parent 76f7ed4 commit 47f0ce2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/collector/python/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func testGetSubprocessOutputUnknownBin(t *testing.T) {
assert.Equal(t, "", C.GoString(cStdout))
assert.Equal(t, "", C.GoString(cStderr))
assert.Equal(t, C.int(0), cRetCode)
assert.NotNil(t, exception)
assert.Nil(t, exception)
}

func testGetSubprocessOutputError(t *testing.T) {
Expand Down
6 changes: 1 addition & 5 deletions pkg/collector/python/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ func GetSubprocessOutput(argv **C.char, env **C.char, cStdout **C.char, cStderr
outputErr, _ = io.ReadAll(stderr)
}()

err = cmd.Start()
if err != nil {
*exception = TrackedCString(fmt.Sprintf("internal error starting subprocess: %v", err))
return
}
cmd.Start() //nolint:errcheck

// Wait for the pipes to be closed *before* waiting for the cmd to exit, as per os.exec docs
wg.Wait()
Expand Down

0 comments on commit 47f0ce2

Please sign in to comment.