[Lldb-commits] [lldb] [lldb][windows] refactor the version check in @skipIfWindows (PR #172838)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 18 07:49:52 PST 2025


================
@@ -300,6 +301,25 @@ def getCompilerVersion():
     return "unknown"
 
 
+def getWindowsVersion():
+    """Returns a string that represents the Windows version.
+
+    The string is a concatenation of the following, eparated by a dot:
+      - The major version number.
+      - The build number.
+
+    Example:
+      - Windows 11 version 24H2 -> "10.26100"
+      - Windows 10 version 1809 -> "10.17763"
+    """
+    import sys
+
+    if sys.platform != "win32":
+        return "unknown"
+    windows_version = sys.getwindowsversion()
+    return f"{windows_version.major}.{windows_version.build}"
----------------
charles-zablit wrote:

I made sure it matches the versions of the PS command, see: https://github.com/llvm/llvm-project/pull/172838#discussion_r2631606944

https://github.com/llvm/llvm-project/pull/172838


More information about the lldb-commits mailing list