mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Merge pull request #286 from karthiknadig/bugs
Minor fixes to system info
This commit is contained in:
commit
2ae11617f7
1 changed files with 22 additions and 13 deletions
|
|
@ -7,7 +7,6 @@ from __future__ import print_function, absolute_import
|
|||
import atexit
|
||||
import contextlib
|
||||
import errno
|
||||
import getpass
|
||||
import io
|
||||
import os
|
||||
import platform
|
||||
|
|
@ -1442,28 +1441,41 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
|
|||
except AttributeError:
|
||||
pid = None
|
||||
|
||||
try:
|
||||
username = getpass.getuser()
|
||||
except AttributeError:
|
||||
username = None
|
||||
|
||||
try:
|
||||
impl_desc = platform.python_implementation()
|
||||
except AttributeError:
|
||||
try:
|
||||
impl_desc = sys.implementation.name
|
||||
except AttributeError:
|
||||
impl_desc = 'Python'
|
||||
impl_desc = None
|
||||
|
||||
def version_str(v):
|
||||
return '{}.{}.{}{}{}'.format(
|
||||
v.major,
|
||||
v.minor,
|
||||
v.micro,
|
||||
v.releaselevel,
|
||||
v.serial)
|
||||
|
||||
try:
|
||||
impl_name = sys.implementation.name
|
||||
except AttributeError:
|
||||
impl_name = None
|
||||
|
||||
try:
|
||||
impl_version = version_str(sys.implementation.version)
|
||||
except AttributeError:
|
||||
impl_version = None
|
||||
|
||||
sys_info = {
|
||||
'ptvsd': {
|
||||
'version': __version__,
|
||||
},
|
||||
'python': {
|
||||
'version': list(sys.version_info),
|
||||
'version': version_str(sys.version_info),
|
||||
'implementation': {
|
||||
'name': sys.implementation.name,
|
||||
'version': list(sys.implementation.version),
|
||||
'name': impl_name,
|
||||
'version': impl_version,
|
||||
'description': impl_desc,
|
||||
},
|
||||
},
|
||||
|
|
@ -1475,9 +1487,6 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
|
|||
'executable': sys.executable,
|
||||
'bitness': 64 if sys.maxsize > 2**32 else 32,
|
||||
},
|
||||
'user': {
|
||||
'name': username,
|
||||
},
|
||||
}
|
||||
self.send_response(request, **sys_info)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue