From f84edc5ae15393a7d5dd4fb142ceb98499824c03 Mon Sep 17 00:00:00 2001 From: Greg Meyer Date: Thu, 22 Jun 2017 18:42:28 -0400 Subject: [PATCH] swallow python error for python version (#51) --- pkg/gohai/platform/platform_common.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/gohai/platform/platform_common.go b/pkg/gohai/platform/platform_common.go index 02392c2..90c64d5 100644 --- a/pkg/gohai/platform/platform_common.go +++ b/pkg/gohai/platform/platform_common.go @@ -33,10 +33,13 @@ func getPlatformInfo() (platformInfo map[string]interface{}, err error) { platformInfo, err = getArchInfo() platformInfo["goV"] = strings.Replace(runtime.Version(), "go", "", -1) - pythonV, err := getPythonVersion() + // If this errors, swallow the error. + // It will usually mean that Python is not on the PATH + // and we don't care about that. + pythonV, e := getPythonVersion() // if there was no failure, add the python variables to the platformInfo - if err == nil { + if e == nil { platformInfo["pythonV"] = pythonV }