Skip to content

Commit

Permalink
NXDRIVE-2790: Mac version format issue (#3609)
Browse files Browse the repository at this point in the history
NXDRIVE-2790: Mac version format issue
  • Loading branch information
swetayadav1 authored Sep 21, 2022
1 parent 36666ea commit c95e337
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changes/5.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Release date: `2022-xx-xx`
## Tests

- [NXDRIVE-2](https://jira.nuxeo.com/browse/NXDRIVE-2):
- [NXDRIVE-2790](https://jira.nuxeo.com/browse/NXDRIVE-2790): Mac version format issue

## Docs

Expand Down
7 changes: 6 additions & 1 deletion nxdrive/metrics/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import platform
import re
from functools import lru_cache
from typing import Tuple

Expand All @@ -17,7 +18,11 @@ def _get_current_os_details() -> Tuple[str, str, str]:
"""
if MAC:
name = "macOS"
ver_full = platform.mac_ver()[0] # 10.15.3
mac_ver = platform.mac_ver()[0]
if re.fullmatch(r"\d{2}\.\d{1,2}\.\d{1,2}$", mac_ver):
ver_full = mac_ver # 10.15.3
else:
ver_full = mac_ver + ".0"
elif WINDOWS:
name = "Windows"
ver_full = platform.win32_ver()[1] # 10.0.19041
Expand Down

0 comments on commit c95e337

Please sign in to comment.