Skip to content

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Jan 16, 2020

It's generally safer to compare to the sys.version_info tuple than the sys.version string, which can include assumptions that each version component is always a single character.


There's also some code which uses six.PY3, similar to:

if six.PY3:
    print("Python 3+ code")
else:
    print "Python 2 code" 

Where:

PY3 = sys.version_info[0] == 3

When run on Python 4, this will run the Python 2 code!

Instead, use six.PY2.


Found with https://github.com/asottile/flake8-2020.

@coveralls
Copy link

coveralls commented Jan 16, 2020

Coverage Status

Coverage decreased (-0.03%) to 96.964% when pulling 0cbfad8 on hugovk:fix-flake8-2020 into 7a24229 on warner:master.

@hugovk
Copy link
Contributor Author

hugovk commented Jan 16, 2020

The Python 3.4 failure is unrelated and also happens on master, because it's EOL and dependencies are dropping support for it:

@tomato42
Copy link
Member

The Python 3.4 failure is unrelated and also happens on master, because it's EOL and dependencies are dropping support for it:

* https://travis-ci.org/hugovk/python-ecdsa/builds/637634120

we are targeting all python versions that have support, be it from community in Debian or from Red Hat in RHEL, we don't limit ourselves to upstream python support

@hugovk
Copy link
Contributor Author

hugovk commented Jan 16, 2020

we are targeting all python versions that have support, be it from community in Debian or from Red Hat in RHEL, we don't limit ourselves to upstream python support

Sure, I guess you'll need to pin some more dependencies.

@tomato42 tomato42 added the bug unintended behaviour in ecdsa code label Jan 16, 2020
@tomato42
Copy link
Member

ok, builds should be fixed with #183, could you rebase on current master?

@hugovk
Copy link
Contributor Author

hugovk commented Jan 16, 2020

Done and Travis is ✅!

Copy link
Member

@tomato42 tomato42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks!

@tomato42 tomato42 merged commit e24c027 into tlsfuzzer:master Jan 16, 2020
@hugovk hugovk deleted the fix-flake8-2020 branch January 16, 2020 16:22
@hugovk
Copy link
Contributor Author

hugovk commented Jan 16, 2020

You're welcome, thank you for maintaining ecdsa!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unintended behaviour in ecdsa code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants