File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ Changelog
4
4
Changes in Version 4.8.0
5
5
-------------------------
6
6
7
+ The handshake metadata for "os.name" on Windows has been simplified to "Windows" to improve import time.
8
+
7
9
.. warning :: PyMongo 4.8 drops support for Python 3.7 and PyPy 3.8: Python 3.8+ or PyPy 3.9+ is now required.
8
10
9
11
Changes in Version 4.7.2
Original file line number Diff line number Diff line change @@ -211,13 +211,14 @@ def _set_keepalive_times(sock: socket.socket) -> None:
211
211
"version" : platform .mac_ver ()[0 ],
212
212
}
213
213
elif sys .platform == "win32" :
214
+ _ver = sys .getwindowsversion ()
214
215
_METADATA ["os" ] = {
215
- "type" : platform . system () ,
216
- # "Windows XP", "Windows 7", "Windows 10", etc.
217
- "name" : " " . join (( platform . system (), platform . release ())),
218
- "architecture" : platform .machine (),
219
- # Windows patch level (e.g. 5.1.2600-SP3)
220
- "version" : "- " .join (platform . win32_ver ()[ 1 :3 ]),
216
+ "type" : "Windows" ,
217
+ "name" : "Windows" ,
218
+ # Avoid using platform calls, see PYTHON-4455.
219
+ "architecture" : os . environ . get ( "PROCESSOR_ARCHITECTURE" ) or platform .machine (),
220
+ # Windows patch level (e.g. 10.0.17763-SP0).
221
+ "version" : ". " .join (map ( str , _ver [ :3 ])) + f"-SP { _ver [ - 1 ] or '0' } " ,
221
222
}
222
223
elif sys .platform .startswith ("java" ):
223
224
_name , _ver , _arch = platform .java_ver ()[- 1 ]
You can’t perform that action at this time.
0 commit comments