From 897870843cc655a1ac89b8ea8c8322684c9ffca4 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 21 Oct 2019 13:06:08 +0200 Subject: [PATCH 1/2] build: avoid bare exceptions in xcode_emulation.py https://realpython.com/the-most-diabolical-python-antipattern/ --- gyp/pylib/gyp/xcode_emulation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gyp/pylib/gyp/xcode_emulation.py b/gyp/pylib/gyp/xcode_emulation.py index 74735c033a..13964beec6 100644 --- a/gyp/pylib/gyp/xcode_emulation.py +++ b/gyp/pylib/gyp/xcode_emulation.py @@ -437,7 +437,7 @@ def _GetSdkVersionInfoItem(self, sdk, infoitem): # most sensible route and should still do the right thing. try: return GetStdoutQuiet(['xcodebuild', '-version', '-sdk', sdk, infoitem]) - except: + except GypError: pass def _SdkRoot(self, configname): @@ -1135,7 +1135,7 @@ def _DefaultSdkRoot(self): return default_sdk_root try: all_sdks = GetStdout(['xcodebuild', '-showsdks']) - except: + except GypError: # If xcodebuild fails, there will be no valid SDKs return '' for line in all_sdks.splitlines(): @@ -1276,7 +1276,7 @@ def XcodeVersion(): # checking that version. if len(version_list) < 2: raise GypError("xcodebuild returned unexpected results") - except: + except GypError: version = CLTVersion() if version: version = ".".join(version.split(".")[:3]) @@ -1314,7 +1314,7 @@ def CLTVersion(): try: output = GetStdout(['/usr/sbin/pkgutil', '--pkg-info', key]) return re.search(regex, output).groupdict()['version'] - except: + except GypError: continue From 177052d4ce38e172ee4e5838360109f647d5f47e Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 22 Oct 2019 12:25:18 +0200 Subject: [PATCH 2/2] brew upgrade npm --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87cbbdcc46..518543a3c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ matrix: python: 2.7 - name: "Python 2.7 on macOS" os: osx - osx_image: xcode11 + osx_image: xcode11.2 language: shell # 'language: python' is not yet supported on macOS env: NODE_GYP_FORCE_PYTHON=python2 before_install: HOMEBREW_NO_AUTO_UPDATE=1 brew install npm @@ -57,10 +57,10 @@ matrix: - name: "Python 3.7 on macOS" os: osx - #osx_image: xcode11 + osx_image: xcode11.2 language: shell # 'language: python' is not yet supported on macOS env: NODE_GYP_FORCE_PYTHON=python3 - before_install: HOMEBREW_NO_AUTO_UPDATE=1 brew install npm + before_install: HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade npm || true - name: "Node.js 12 & Python 3.7 on Windows" os: windows language: node_js