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
Improved py36 support #202
Conversation
Can one of the admins verify this patch? |
Yes, sure. If this goes well, I'm planning to make couple more commits |
tests/addresslib/validator_test.py
Outdated
@@ -11,6 +12,9 @@ | |||
from flanker.addresslib import address, validate | |||
|
|||
|
|||
PY3 = sys.version_info[0] == 3 |
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.
Everywhere else we use six.PY3
instead, please do the same for consistency.
Made the change about six.PY3 that you requested. Also reverted expanded if...else back to ternary. It seems to me that the part of the condition where there is a dot at the end is not reachable by the execution, because the domain comes to this function after being processed by the email validation and it doesn't seem to allow domains in FQDN form with dot at the end. Also reverted version change in setup.py as to not to impose any particular version for this change to be released in. |
Could you please squash your commits, and then I will merge. |
Done |
@eserge thank you for your contribution. |
The changes made here are dealing with the differences between iteration functions in py3 and py2. Specifically,
dnsq
returns a result of a filter function from itsmx_hosts_for
function. In Python 2 it's a list, but for py3 it's an iterator. Later flanker tries to get alen
of that list which is impossible with an iterator. So this pull request deals with this by converting iterator to a list.Other than that there are some improvements in tests.