]> Cypherpunks repositories - keks.git/commitdiff
Fix grammar
authorSergey Matveev <stargrave@stargrave.org>
Sat, 30 Nov 2024 19:23:55 +0000 (22:23 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 30 Nov 2024 19:38:56 +0000 (22:38 +0300)
Key can not "contain" the string, but key can be the string.

pyac/pyac.py
pyac/tests/test_map.py

index 5c670cd13231bc95f4ba78256948d74b6e332095050016ec15fbdb5f4e086484..39b22d488beeba1771eb4af65462ac44d96cdfca9c8d4c2560786e4c515dc8f5 100755 (executable)
@@ -218,7 +218,7 @@ def dumps(v):
     if isinstance(v, dict):
         raws = [_byte(TagMap)]
         if not all(isinstance(k, str) for k in v.keys()):
-            raise ValueError("map keys can contain only strings")
+            raise ValueError("map keys can be only strings")
         for k in sorted(v.keys(), key=LenFirstSort):
             if len(k) == 0:
                 raise ValueError("map keys can not be empty")
index 31ee2ebc64bc6068f7f6e1470bb16d0fc31597f55a6afcd21b79bf6ada982d95..c0c753e234a3b02dfa52d05885bcccb8262819402249fcf72d3385dfb8ee2c6d 100644 (file)
@@ -66,7 +66,7 @@ class TestMap(TestCase):
     def test_throws_when_encoding_non_string_key(self):
         with self.assertRaises(ValueError) as err:
             dumps({1: "a"})
-        self.assertEqual(str(err.exception), "map keys can contain only strings")
+        self.assertEqual(str(err.exception), "map keys can be only strings")
 
     def test_throws_when_decoding_non_string_key(self):
         encoded = b"\x09\x0c\x80\xc6value2\x00"