mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
CI fixes
This commit is contained in:
parent
12c02f6612
commit
c10628acb7
5 changed files with 39 additions and 0 deletions
|
|
@ -1937,6 +1937,7 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
|
|||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(only_keys));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(oparg));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(opcode));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(opcodes));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(open));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(opener));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(operation));
|
||||
|
|
|
|||
|
|
@ -660,6 +660,7 @@ struct _Py_global_strings {
|
|||
STRUCT_FOR_ID(only_keys)
|
||||
STRUCT_FOR_ID(oparg)
|
||||
STRUCT_FOR_ID(opcode)
|
||||
STRUCT_FOR_ID(opcodes)
|
||||
STRUCT_FOR_ID(open)
|
||||
STRUCT_FOR_ID(opener)
|
||||
STRUCT_FOR_ID(operation)
|
||||
|
|
|
|||
1
Include/internal/pycore_runtime_init_generated.h
generated
1
Include/internal/pycore_runtime_init_generated.h
generated
|
|
@ -1935,6 +1935,7 @@ extern "C" {
|
|||
INIT_ID(only_keys), \
|
||||
INIT_ID(oparg), \
|
||||
INIT_ID(opcode), \
|
||||
INIT_ID(opcodes), \
|
||||
INIT_ID(open), \
|
||||
INIT_ID(opener), \
|
||||
INIT_ID(operation), \
|
||||
|
|
|
|||
|
|
@ -2420,6 +2420,10 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
|
|||
_PyUnicode_InternStatic(interp, &string);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
assert(PyUnicode_GET_LENGTH(string) != 1);
|
||||
string = &_Py_ID(opcodes);
|
||||
_PyUnicode_InternStatic(interp, &string);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
assert(PyUnicode_GET_LENGTH(string) != 1);
|
||||
string = &_Py_ID(open);
|
||||
_PyUnicode_InternStatic(interp, &string);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
|
|
|
|||
|
|
@ -1,11 +1,43 @@
|
|||
"""Common test helpers and mocks for live collector tests."""
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
from profiling.sampling.constants import (
|
||||
THREAD_STATUS_HAS_GIL,
|
||||
THREAD_STATUS_ON_CPU,
|
||||
)
|
||||
|
||||
|
||||
# Matches the C structseq LocationInfo from _remote_debugging
|
||||
LocationInfo = namedtuple('LocationInfo', ['lineno', 'end_lineno', 'col_offset', 'end_col_offset'])
|
||||
|
||||
|
||||
class MockFrameInfo:
|
||||
"""Mock FrameInfo for testing.
|
||||
|
||||
Frame format: (filename, location, funcname, opcode) where:
|
||||
- location is a tuple (lineno, end_lineno, col_offset, end_col_offset)
|
||||
- opcode is an int or None
|
||||
"""
|
||||
|
||||
def __init__(self, filename, lineno, funcname, opcode=None):
|
||||
self.filename = filename
|
||||
self.funcname = funcname
|
||||
self.opcode = opcode
|
||||
self.location = LocationInfo(lineno, lineno, -1, -1)
|
||||
|
||||
def __iter__(self):
|
||||
return iter((self.filename, self.location, self.funcname, self.opcode))
|
||||
|
||||
def __getitem__(self, index):
|
||||
return (self.filename, self.location, self.funcname, self.opcode)[index]
|
||||
|
||||
def __len__(self):
|
||||
return 4
|
||||
|
||||
def __repr__(self):
|
||||
return f"MockFrameInfo('{self.filename}', {self.location}, '{self.funcname}', {self.opcode})"
|
||||
|
||||
|
||||
class MockThreadInfo:
|
||||
"""Mock ThreadInfo for testing."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue