From 08059680f08a197011b58f141a0e334e3a7e46ca Mon Sep 17 00:00:00 2001
From: Jonathan Chang <me@jonathanchang.org>
Date: Mon, 21 Sep 2020 01:15:31 +1000
Subject: [PATCH] diagnostic: fix xattr check

Python emits the version on either stderr or stdout based on major
version, so just to be safe let's use popen_read and combine the
output streams.
---
 Library/Homebrew/diagnostic.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index cade2779a7..2b9f166981 100644
--- a/Library/Homebrew/diagnostic.rb
+++ b/Library/Homebrew/diagnostic.rb
@@ -968,9 +968,9 @@ module Homebrew
         return if result.status.success?
 
         if result.stderr.include? "ImportError: No module named pkg_resources"
-          result = system_command "/usr/bin/python", "--version"
+          result = Utils.popen_read "/usr/bin/python", "--version", err: :out
 
-          if result.stdout.include? "Python 2.7"
+          if result.include? "Python 2.7"
             <<~EOS
               Your Python installation has a broken version of setuptools.
               To fix, reinstall macOS or run 'sudo /usr/bin/python -m pip install -I setuptools'.
-- 
GitLab