[Lldb-commits] [lldb] r344623 - [lldbsuite] Fix the mac version decorator to work on non-mac platforms

Stella Stamenova via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 16 10:13:45 PDT 2018

Author: stella.stamenova
Date: Tue Oct 16 10:13:45 2018
New Revision: 344623

URL: http://llvm.org/viewvc/llvm-project?rev=344623&view=rev
[lldbsuite] Fix the mac version decorator to work on non-mac platforms

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


Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=344623&r1=344622&r2=344623&view=diff
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Tue Oct 16 10:13:45 2018
@@ -192,10 +192,10 @@ def _decorateTest(mode,
             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(
-                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

More information about the lldb-commits mailing list