Skip to content

Commit

Permalink
PYTHON-4977 Fix import time on Windows again (#2003)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneHarvey authored Nov 15, 2024
1 parent 72a5109 commit 35b2fbb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pymongo/pool_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@
"version": platform.mac_ver()[0],
}
elif sys.platform == "win32":
_ver = sys.getwindowsversion()
_METADATA["os"] = {
"type": platform.system(),
# "Windows XP", "Windows 7", "Windows 10", etc.
"name": " ".join((platform.system(), platform.release())),
"architecture": platform.machine(),
# Windows patch level (e.g. 5.1.2600-SP3)
"version": "-".join(platform.win32_ver()[1:3]),
"type": "Windows",
"name": "Windows",
# Avoid using platform calls, see PYTHON-4455.
"architecture": os.environ.get("PROCESSOR_ARCHITECTURE") or platform.machine(),
# Windows patch level (e.g. 10.0.17763-SP0).
"version": ".".join(map(str, _ver[:3])) + f"-SP{_ver[-1] or '0'}",
}
elif sys.platform.startswith("java"):
_name, _ver, _arch = platform.java_ver()[-1]
Expand Down

0 comments on commit 35b2fbb

Please sign in to comment.