Closed mgaitan closed 9 years ago
Why is the call to list()
necessary there?
because in python3(.4) you can't use reversed
over a non-sequence iterable.
all test fails like this
ERROR: test_register_unregister (micawber.tests.ProviderTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tin/lab/micawber/micawber/tests.py", line 19, in test_register_unregister
self.assertEqual(pr.provider_for_url('1'), provider1)
File "/home/tin/lab/micawber/micawber/providers.py", line 136, in provider_for_url
for regex, provider in self:
File "/home/tin/lab/micawber/micawber/providers.py", line 133, in __iter__
return iter(reversed(self._registry.items()))
TypeError: argument to reversed() must be a sequence
why you are reversing them, btw?
Thanks for this!
This patch fix the python3.4 compatibility. All tests pass. Fix #45