Skip to content

Commit 7750486

Browse files
committed
Normal dictionary construction works now :D
1 parent a19ca6d commit 7750486

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Lib/test/test_regions/test_dict.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ class Value:
6767
d = {key1: val1, key2: val2, key3: val3}
6868
self.assertTrue(is_local(d))
6969
self.assertEqual(val_region._lrc, val_lrc + 3,
70-
"The LRC of the value region should be adjusted")
70+
f"The LRC of the value region should be adjusted. Base LRC: {val_lrc}")
7171
self.assertEqual(key_region._lrc, key_lrc + (3 * lrc_per_key),
72-
"The LRC of the key region should be adjusted")
72+
f"The LRC of the key region should be adjusted. Base LRC: {key_lrc}")
7373

7474

7575
def check_dict_assign(self, dict, key):

Objects/dictobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,8 @@ insert_combined_dict(PyInterpreterState *interp, PyDictObject *mp,
17931793
if (PyRegion_AddRefs(mp, key, value) != 0) {
17941794
return -1;
17951795
}
1796+
PyRegion_RemoveLocalRef(key);
1797+
PyRegion_RemoveLocalRef(value);
17961798

17971799
_PyDict_NotifyEvent(interp, PyDict_EVENT_ADDED, mp, key, value);
17981800
FT_ATOMIC_STORE_UINT32_RELAXED(mp->ma_keys->dk_version, 0);

0 commit comments

Comments
 (0)