Skip to content

Commit dc5e8d3

Browse files
authored
Merge branch 'main' into jit/gc
2 parents 2f9ab2c + 97e1901 commit dc5e8d3

21 files changed

+261
-66
lines changed

Include/cpython/pystats.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ typedef struct _optimization_stats {
142142
uint64_t recursive_call;
143143
uint64_t low_confidence;
144144
uint64_t unknown_callee;
145+
uint64_t trace_immediately_deopts;
145146
uint64_t executors_invalidated;
146147
UOpStats opcode[PYSTATS_MAX_UOP_ID + 1];
147148
uint64_t unsupported_opcode[256];

Lib/enum.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,12 +774,16 @@ def __delattr__(cls, attr):
774774
super().__delattr__(attr)
775775

776776
def __dir__(cls):
777+
if issubclass(cls, Flag):
778+
members = list(cls._member_map_.keys())
779+
else:
780+
members = cls._member_names_
777781
interesting = set([
778782
'__class__', '__contains__', '__doc__', '__getitem__',
779783
'__iter__', '__len__', '__members__', '__module__',
780784
'__name__', '__qualname__',
781785
]
782-
+ cls._member_names_
786+
+ members
783787
)
784788
if cls._new_member_ is not object.__new__:
785789
interesting.add('__new__')

Lib/profiling/sampling/_heatmap_assets/heatmap_shared.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,18 @@ function intensityToColor(intensity) {
3838
const rootStyle = getComputedStyle(document.documentElement);
3939
return rootStyle.getPropertyValue(`--heat-${level}`).trim();
4040
}
41+
42+
// ============================================================================
43+
// Favicon (Reuse logo image as favicon)
44+
// ============================================================================
45+
46+
(function() {
47+
const logo = document.querySelector('.brand-logo img');
48+
if (logo) {
49+
const favicon = document.createElement('link');
50+
favicon.rel = 'icon';
51+
favicon.type = 'image/png';
52+
favicon.href = logo.src;
53+
document.head.appendChild(favicon);
54+
}
55+
})();

Lib/test/test_enum.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5529,12 +5529,16 @@ def test_enum_dict_standalone(self):
55295529
# helpers
55305530

55315531
def enum_dir(cls):
5532+
if issubclass(cls, Flag):
5533+
members = list(cls._member_map_.keys())
5534+
else:
5535+
members = cls._member_names_
55325536
interesting = set([
55335537
'__class__', '__contains__', '__doc__', '__getitem__',
55345538
'__iter__', '__len__', '__members__', '__module__',
55355539
'__name__', '__qualname__',
55365540
]
5537-
+ cls._member_names_
5541+
+ members
55385542
)
55395543
if cls._new_member_ is not object.__new__:
55405544
interesting.add('__new__')

Lib/test/test_import/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,20 @@ class Spec2:
12531253
origin = "a\x00b"
12541254
_imp.create_dynamic(Spec2())
12551255

1256+
def test_create_builtin(self):
1257+
class Spec:
1258+
name = None
1259+
spec = Spec()
1260+
1261+
with self.assertRaisesRegex(TypeError, 'name must be string, not NoneType'):
1262+
_imp.create_builtin(spec)
1263+
1264+
spec.name = ""
1265+
1266+
# gh-142029
1267+
with self.assertRaisesRegex(ValueError, 'name must not be empty'):
1268+
_imp.create_builtin(spec)
1269+
12561270
def test_filter_syntax_warnings_by_module(self):
12571271
module_re = r'test\.test_import\.data\.syntax_warnings\z'
12581272
unload('test.test_import.data.syntax_warnings')
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add ``LDVERSION`` and ``EXE`` to the ``base_interpreter`` value of
2+
``build-details.json``.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug during JIT compilation failure which caused garbage collection debug assertions to fail.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Protect against specialization failures in the tracing JIT compiler for performance reasons.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Raise :exc:`ValueError` instead of crashing when empty string is used as a name
2+
in ``_imp.create_builtin()``.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Decrease the size of the generated stencils and the runtime JIT code. Patch by Diego Russo.

0 commit comments

Comments
 (0)