-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Python 2 support #116
Conversation
0c51a50
to
95c4e4d
Compare
95c4e4d
to
9a3c69c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you address the 2 comments I have made? Otherwise it looks good to me!
9a3c69c
to
88b758d
Compare
I fixed what you asked for, and the tests still run fine. the coverage change looks strange, but looking it the numbers it didn’t actually change (the same amount of code lines are covered as before, we just lost some previously tested code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made travis work with Python 3.7 here: https://github.com/flaskbb/flaskbb/blob/7b869949d9fb0c13bd0c12c79d556be7da2eba30/.travis.yml
But we can handle this in a separate PR :-)
flask_caching/backends/base.py
Outdated
@@ -13,7 +10,7 @@ def iteritems_wrapper(mappingorseq): | |||
|
|||
""" | |||
if hasattr(mappingorseq, "items"): | |||
return iteritems(mappingorseq) | |||
return iter(mappingorseq.items()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Python 3, items() returns an iterator and not a list --> iter
is not needed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was suspicious for me, i just couldn’t wrap my head around it early in the morning i guess.
flask_caching/backends/memcache.py
Outdated
@@ -97,7 +97,7 @@ def get_dict(self, *keys): | |||
d = rv = self._client.get_multi(_keys) | |||
if have_encoded_keys or self.key_prefix: | |||
rv = {} | |||
for key, value in iteritems(d): | |||
for key, value in iter(d.items()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iter(d.items())
--> d.items()
88b758d
to
2a8a8aa
Compare
There, everything is fixed. Take a look and merge when you see fit. |
2a8a8aa
to
0203c02
Compare
Everything looks good now! Thanks! |
No description provided.