diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py index d6fc0bd5754..f8cb6170a96 100644 --- a/gdb/python/lib/gdb/dap/server.py +++ b/gdb/python/lib/gdb/dap/server.py @@ -15,6 +15,7 @@ import json import queue +import sys from .io import start_json_writer, read_json from .startup import ( @@ -47,7 +48,10 @@ class Server: # This queue accepts JSON objects that are then sent to the # DAP client. Writing is done in a separate thread to avoid # blocking the read loop. - self.write_queue = queue.SimpleQueue() + if sys.version_info[0] == 3 and sys.version_info[1] <= 6: + self.write_queue = queue.Queue() + else: + self.write_queue = queue.SimpleQueue() self.done = False global _server _server = self diff --git a/gdb/python/lib/gdb/dap/startup.py b/gdb/python/lib/gdb/dap/startup.py index acfdcb4d81b..523705a5933 100644 --- a/gdb/python/lib/gdb/dap/startup.py +++ b/gdb/python/lib/gdb/dap/startup.py @@ -22,6 +22,7 @@ import signal import threading import traceback from contextlib import contextmanager +import sys # The GDB thread, aka the main thread. @@ -173,7 +174,10 @@ def send_gdb_with_response(fn): """ if isinstance(fn, str): fn = Invoker(fn) - result_q = queue.SimpleQueue() + if sys.version_info[0] == 3 and sys.version_info[1] <= 6: + result_q = queue.Queue() + else: + result_q = queue.SimpleQueue() def message(): try: