Skip to content

Commit

Permalink
Fix CIMultiDict constructor for case of accepting istr #11
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Sep 22, 2016
1 parent f7a11f4 commit c79c3a3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2.1.1 (2016-09-22)
------------------

* Fix `CIMultiDict` constructor for case of accepting `istr` #11


2.1.0 (2016-09-18)
------------------

Expand Down
2 changes: 1 addition & 1 deletion multidict/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__all__ = ('MultiDictProxy', 'CIMultiDictProxy',
'MultiDict', 'CIMultiDict', 'upstr', 'istr')

__version__ = '2.1.0'
__version__ = '2.1.1'


if bool(os.environ.get('MULTIDICT_NO_EXTENSIONS')):
Expand Down
4 changes: 2 additions & 2 deletions multidict/_multidict.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ cdef class MultiDict(_Base):

cdef _extend(self, tuple args, dict kwargs, name, int do_add):
cdef _Pair item
cdef str key
cdef object key

if len(args) > 1:
raise TypeError("{} takes at most 1 positional argument"
Expand Down Expand Up @@ -308,7 +308,7 @@ cdef class MultiDict(_Base):
else:
self._replace(key, value)

cdef _add(self, str key, value):
cdef _add(self, key, value):
self._items.append(_Pair.__new__(_Pair, key, value))

cdef _replace(self, str key, value):
Expand Down
5 changes: 5 additions & 0 deletions tests/test_multidict.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,11 @@ def test_update(self):

self.assertEqual([('Key2', 'val3'), ('Key', 'val')], list(d.items()))

def test_copy_istr(self):
d = self.make_dict({istr('Foo'): 'bar'})
d2 = d.copy()
self.assertEqual(d, d2)


class TestPyMultiDictProxy(_TestProxy, unittest.TestCase):

Expand Down

0 comments on commit c79c3a3

Please sign in to comment.