Skip to content

Commit c79c3a3

Browse files
committed
Fix CIMultiDict constructor for case of accepting istr #11
1 parent f7a11f4 commit c79c3a3

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2.1.1 (2016-09-22)
2+
------------------
3+
4+
* Fix `CIMultiDict` constructor for case of accepting `istr` #11
5+
6+
17
2.1.0 (2016-09-18)
28
------------------
39

multidict/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
__all__ = ('MultiDictProxy', 'CIMultiDictProxy',
1111
'MultiDict', 'CIMultiDict', 'upstr', 'istr')
1212

13-
__version__ = '2.1.0'
13+
__version__ = '2.1.1'
1414

1515

1616
if bool(os.environ.get('MULTIDICT_NO_EXTENSIONS')):

multidict/_multidict.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ cdef class MultiDict(_Base):
252252

253253
cdef _extend(self, tuple args, dict kwargs, name, int do_add):
254254
cdef _Pair item
255-
cdef str key
255+
cdef object key
256256

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

311-
cdef _add(self, str key, value):
311+
cdef _add(self, key, value):
312312
self._items.append(_Pair.__new__(_Pair, key, value))
313313

314314
cdef _replace(self, str key, value):

tests/test_multidict.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,11 @@ def test_update(self):
745745

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

748+
def test_copy_istr(self):
749+
d = self.make_dict({istr('Foo'): 'bar'})
750+
d2 = d.copy()
751+
self.assertEqual(d, d2)
752+
748753

749754
class TestPyMultiDictProxy(_TestProxy, unittest.TestCase):
750755

0 commit comments

Comments
 (0)