Skip to content

Commit

Permalink
[lldbsuite] Fix the mac version decorator to work on non-mac platforms
Browse files Browse the repository at this point in the history
Summary: On non-mac platforms, mac_ver returns an empty string which when converted to LooseVersion has no "version" property. This causes a failure when the decorator executes. Instead, check whether the value returned from mac_ver is an empty string and avoid the LooseVersion comparison.

Reviewers: labath, davide, asmith, shafik, jingham

Reviewed By: jingham

Subscribers: jingham, lldb-commits

Differential Revision: https://reviews.llvm.org/D53208

llvm-svn: 344623
  • Loading branch information
sstamenova committed Oct 16, 2018
1 parent 4b5ec7f commit e05451b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lldb/packages/Python/lldbsuite/test/decorators.py
Expand Up @@ -192,10 +192,10 @@ def fn(self):
py_version is None) or _check_expected_version(
py_version[0], py_version[1], sys.version_info)
skip_for_macos_version = (macos_version is None) or (
_check_expected_version(
(platform.mac_ver()[0] != "") and (_check_expected_version(
macos_version[0],
macos_version[1],
platform.mac_ver()[0]))
platform.mac_ver()[0])))

# For the test to be skipped, all specified (e.g. not None) parameters must be True.
# An unspecified parameter means "any", so those are marked skip by default. And we skip
Expand Down

0 comments on commit e05451b

Please sign in to comment.