Skip to content

Commit 3c31b38

Browse files
committed
Fix error message
Conflicts: aiohttp/multidict.py
1 parent ceabc58 commit 3c31b38

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

aiohttp/multidict.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ class MultiDict(abc.Mapping):
1515

1616
def __init__(self, *args, **kwargs):
1717
if len(args) > 1:
18-
raise TypeError("MultiDict takes at most 2 positional "
19-
"arguments ({} given)".format(len(args) + 1))
18+
raise TypeError("MultiDict takes at most 1 positional "
19+
"arguments ({} given)".format(len(args)))
2020
self._items = OrderedDict()
21+
2122
if args:
2223
if hasattr(args[0], 'items'):
2324
args = list(args[0].items())

tests/test_multidict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_instantiate__empty(self):
2121
self.assertEqual(list(d.items(getall=True)), [])
2222

2323
self.assertNotEqual(self.make_dict(), list())
24-
with self.assertRaisesRegex(TypeError, "\(3 given\)"):
24+
with self.assertRaisesRegex(TypeError, "\(2 given\)"):
2525
self.make_dict(('key1', 'value1'), ('key2', 'value2'))
2626

2727
def test_instantiate__from_arg0(self):

0 commit comments

Comments
 (0)