Skip to content

Commit df2e639

Browse files
committed
wip
1 parent 3030fa9 commit df2e639

33 files changed

+177
-50
lines changed

.github/workflows/pydevd-tests-python.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
"windows-py312-cython-checkbin",
2727
"ubuntu-py313-cython",
2828
"windows-py313-cython",
29+
"ubuntu-py314-cython",
30+
"windows-py314-cython",
2931
]
3032

3133
include:
@@ -74,6 +76,14 @@ jobs:
7476
python: "3.13"
7577
os: windows-latest
7678
PYDEVD_USE_CYTHON: YES
79+
- name: "ubuntu-py314-cython"
80+
python: "3.14"
81+
os: ubuntu-20.04
82+
PYDEVD_USE_CYTHON: YES
83+
- name: "windows-py314-cython"
84+
python: "3.14"
85+
os: windows-latest
86+
PYDEVD_USE_CYTHON: YES
7787

7888
steps:
7989
- uses: actions/checkout@v1

_pydev_bundle/pydev_is_thread_alive.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
# It is required to debug threads started by start_new_thread in Python 3.4
66
_temp = threading.Thread()
77

8+
if hasattr(_temp, "_os_thread_handle"): # Python 3.14 and later has this
9+
def is_thread_alive(t):
10+
return not t._os_thread_handle.is_done()
11+
812
if hasattr(_temp, "_handle") and hasattr(_temp, "_started"): # Python 3.13 and later has this
913

1014
def is_thread_alive(t):

_pydev_bundle/pydev_monkey.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,9 @@ def patch_new_process_functions():
10221022
monkey_patch_os("spawnvpe", create_spawnve)
10231023
monkey_patch_os("posix_spawn", create_posix_spawn)
10241024

1025+
if not IS_WINDOWS:
1026+
monkey_patch_os("posix_spawnp", create_posix_spawn)
1027+
10251028
if not IS_JYTHON:
10261029
if not IS_WINDOWS:
10271030
monkey_patch_os("fork", create_fork)

_pydevd_bundle/pydevd_comm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def internal_change_variable_json(py_db, request):
934934
)
935935
return
936936

937-
child_var = variable.change_variable(arguments.name, arguments.value, py_db, fmt=fmt)
937+
child_var = variable.change_variable(arguments.name, arguments.value, py_db, fmt=fmt, scope=scope)
938938

939939
if child_var is None:
940940
_write_variable_response(py_db, request, value="", success=False, message="Unable to change: %s." % (arguments.name,))

_pydevd_bundle/pydevd_dont_trace.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Support for a tag that allows skipping over functions while debugging.
33
"""
4-
54
import linecache
65
import re
76

_pydevd_bundle/pydevd_filtering.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ def _get_default_library_roots(cls):
155155

156156
# Make sure we always get at least the standard library location (based on the `os` and
157157
# `threading` modules -- it's a bit weird that it may be different on the ci, but it happens).
158-
roots.append(os.path.dirname(os.__file__))
158+
if hasattr(os, "__file__"):
159+
roots.append(os.path.dirname(os.__file__))
159160
roots.append(os.path.dirname(threading.__file__))
160161
if IS_PYPY:
161162
# On PyPy 3.6 (7.3.1) it wrongly says that sysconfig.get_path('stdlib') is

_pydevd_bundle/pydevd_net_command.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def __init__(self, cmd_id, seq, text, is_json=False):
7777
as_dict["pydevd_cmd_id"] = cmd_id
7878
as_dict["seq"] = seq
7979
self.as_dict = as_dict
80-
text = json.dumps(as_dict)
80+
try:
81+
text = json.dumps(as_dict)
82+
except TypeError:
83+
text = json.dumps(as_dict, default=str)
8184

8285
assert isinstance(text, str)
8386

_pydevd_bundle/pydevd_plugin_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ def exception_break(self, py_db, frame, thread, arg, is_unwind=False):
199199

200200
return None
201201

202-
def change_variable(self, frame, attr, expression):
202+
def change_variable(self, frame, attr, expression, scope=None):
203203
for plugin in self.active_plugins:
204-
ret = plugin.change_variable(frame, attr, expression, self.EMPTY_SENTINEL)
204+
ret = plugin.change_variable(frame, attr, expression, self.EMPTY_SENTINEL, scope)
205205
if ret is not self.EMPTY_SENTINEL:
206206
return ret
207207

_pydevd_bundle/pydevd_save_locals.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Utility for saving locals.
33
"""
4-
54
import sys
65
from _pydevd_bundle.pydevd_constants import IS_PY313_OR_GREATER
76
from _pydev_bundle import pydev_log

_pydevd_bundle/pydevd_suspended_frames.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def get_children_variables(self, fmt=None, scope=None):
200200

201201
return children_variables
202202

203-
def change_variable(self, name, value, py_db, fmt=None):
203+
def change_variable(self, name, value, py_db, fmt=None, scope: Optional[ScopeRequest]=None):
204204
children_variable = self.get_child_variable_named(name)
205205
if children_variable is None:
206206
return None
@@ -255,12 +255,10 @@ def __init__(self, py_db, frame, register_variable):
255255
self._register_variable = register_variable
256256
self._register_variable(self)
257257

258-
def change_variable(self, name, value, py_db, fmt=None):
258+
def change_variable(self, name, value, py_db, fmt=None, scope: Optional[ScopeRequest]=None):
259259
frame = self.frame
260-
261-
pydevd_vars.change_attr_expression(frame, name, value, py_db)
262-
263-
return self.get_child_variable_named(name, fmt=fmt)
260+
pydevd_vars.change_attr_expression(frame, name, value, py_db, scope=scope)
261+
return self.get_child_variable_named(name, fmt=fmt, scope=scope)
264262

265263
@silence_warnings_decorator
266264
@overrides(_AbstractVariable.get_children_variables)

0 commit comments

Comments
 (0)