7 Module implementing the debug server. |
7 Module implementing the debug server. |
8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 import shlex |
11 import shlex |
|
12 import contextlib |
12 |
13 |
13 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QModelIndex |
14 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QModelIndex |
14 from PyQt5.QtNetwork import ( |
15 from PyQt5.QtNetwork import ( |
15 QTcpServer, QHostAddress, QHostInfo, QNetworkInterface |
16 QTcpServer, QHostAddress, QHostInfo, QNetworkInterface |
16 ) |
17 ) |
423 @type bool |
424 @type bool |
424 @return list of supported languages |
425 @return list of supported languages |
425 @rtype list of str |
426 @rtype list of str |
426 """ |
427 """ |
427 languages = list(self.__debuggerInterfaceRegistry.keys()) |
428 languages = list(self.__debuggerInterfaceRegistry.keys()) |
428 try: |
429 with contextlib.suppress(ValueError): |
429 languages.remove("None") |
430 languages.remove("None") |
430 except ValueError: |
|
431 pass # it is not in the list |
|
432 |
431 |
433 if shellOnly: |
432 if shellOnly: |
434 languages = [lang for lang in languages |
433 languages = [lang for lang in languages |
435 if self.__debuggerInterfaceRegistry[lang][0] & |
434 if self.__debuggerInterfaceRegistry[lang][0] & |
436 DebugClientCapabilities.HasShell] |
435 DebugClientCapabilities.HasShell] |