Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: avoid bare exceptions in xcode_emulation.py #1932

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions gyp/pylib/gyp/xcode_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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


Expand Down