Skip to content

Commit b72bfe4

Browse files
committed
Fix error message: "has been finalized" -> "has been finished"
1 parent e1de4d4 commit b72bfe4

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

immutables/_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3723,7 +3723,7 @@ mapmut_check_finalized(MapMutationObject *o)
37233723
if (o->m_mutid == 0) {
37243724
PyErr_Format(
37253725
PyExc_ValueError,
3726-
"mutation %R has been finalized",
3726+
"mutation %R has been finished",
37273727
o, NULL);
37283728
return -1;
37293729
}

immutables/map.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ def __exit__(self, *exc):
642642

643643
def __delitem__(self, key):
644644
if self.__mutid == 0:
645-
raise ValueError('mutation {!r} has been finalized'.format(self))
645+
raise ValueError('mutation {!r} has been finished'.format(self))
646646

647647
res, new_root = self.__root.without(
648648
0, map_hash(key), key, self.__mutid)
@@ -657,7 +657,7 @@ def __delitem__(self, key):
657657

658658
def __setitem__(self, key, val):
659659
if self.__mutid == 0:
660-
raise ValueError('mutation {!r} has been finalized'.format(self))
660+
raise ValueError('mutation {!r} has been finished'.format(self))
661661

662662
self.__root, added = self.__root.assoc(
663663
0, map_hash(key), key, val, self.__mutid)
@@ -667,7 +667,7 @@ def __setitem__(self, key, val):
667667

668668
def pop(self, key, *args):
669669
if self.__mutid == 0:
670-
raise ValueError('mutation {!r} has been finalized'.format(self))
670+
raise ValueError('mutation {!r} has been finished'.format(self))
671671

672672
if len(args) > 1:
673673
raise TypeError(

tests/test_map.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,16 +1141,16 @@ def test_map_mut_12(self):
11411141
mm = m.mutate()
11421142
mm.finish()
11431143

1144-
with self.assertRaisesRegex(ValueError, 'has been finalized'):
1144+
with self.assertRaisesRegex(ValueError, 'has been finished'):
11451145
mm.pop('a')
11461146

1147-
with self.assertRaisesRegex(ValueError, 'has been finalized'):
1147+
with self.assertRaisesRegex(ValueError, 'has been finished'):
11481148
del mm['a']
11491149

1150-
with self.assertRaisesRegex(ValueError, 'has been finalized'):
1150+
with self.assertRaisesRegex(ValueError, 'has been finished'):
11511151
mm.set('a', 'b')
11521152

1153-
with self.assertRaisesRegex(ValueError, 'has been finalized'):
1153+
with self.assertRaisesRegex(ValueError, 'has been finished'):
11541154
mm['a'] = 'b'
11551155

11561156
def test_map_mut_13(self):

0 commit comments

Comments
 (0)