From cdac331a0643e33ff2dc49d3fa3b2b0aecfe658c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@digia.com>
Date: Thu, 9 Jan 2014 15:30:47 +0100
Subject: [PATCH] Handle exception thrown by subprocess.check_output.

The || true syntax does not work on Windows.

Also, normalize the paths to the underlying OS style.

Change-Id: Ie13d2646fe239fccb9ab7b558a6c8d56b779b206
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
---
 tools/buildscripts/qtwebengine_utils.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/buildscripts/qtwebengine_utils.py b/tools/buildscripts/qtwebengine_utils.py
index b68e2ff50..d8e65bfe7 100755
--- a/tools/buildscripts/qtwebengine_utils.py
+++ b/tools/buildscripts/qtwebengine_utils.py
@@ -51,13 +51,16 @@ def getChromiumSrcDir():
   qtwebengine_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
 
   os.chdir(qtwebengine_root)
-  chrome_src = subprocess.check_output("git config qtwebengine.chromiumsrcdir || true", shell=True).strip()
+  try:
+    chrome_src = subprocess.check_output("git config qtwebengine.chromiumsrcdir", shell=True).strip()
+  except subprocess.CalledProcessError:
+    chrome_src = None
   os.chdir(saved_cwd)
 
   if chrome_src:
     chrome_src = os.path.join(qtwebengine_root, chrome_src)
   if not chrome_src or not os.path.isdir(chrome_src):
-    chrome_src = os.path.join(qtwebengine_root, 'src/3rdparty/chromium')
+    chrome_src = os.path.normpath(os.path.join(qtwebengine_root, 'src/3rdparty/chromium'))
     print 'CHROMIUM_SRC_DIR not set, falling back to ' + chrome_src
   return chrome_src
 
-- 
GitLab