File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed 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