-
Notifications
You must be signed in to change notification settings - Fork 113
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
utils/ordered_dict: don't use compat code for Python 3.7+ #708
Conversation
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.
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ueno)
tlsfuzzer/utils/ordered_dict.py, line 10 at r1 (raw file):
# Dict keeps insertion order in Python 3.7+: # https://mail.python.org/pipermail/python-dev/2017-December/151283.html if (sys.version_info.major, sys.version_info.minor) > (3, 6):
no need to remake the tuple, (3, 6, 7) > (3, 6) == True
and (3, 5, 99) < (3, 6) == True
so it can be just sys.version_info > (3, 6)
0442b33
to
2c8a02b
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.
Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on @tomato42)
tlsfuzzer/utils/ordered_dict.py, line 10 at r1 (raw file):
Previously, tomato42 (Hubert Kario) wrote…
no need to remake the tuple,
(3, 6, 7) > (3, 6) == True
and(3, 5, 99) < (3, 6) == True
so it can be justsys.version_info > (3, 6)
That's good; fixed.
2c8a02b
to
8404a70
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.
Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ueno)
a discussion (no related file):
looks like test cases will need slight adjustments for CI to pass
a discussion (no related file): Previously, tomato42 (Hubert Kario) wrote…
What do you expect to fix them: add compatibility with the legacy OrderdDict methods, or align to the dict (and remove test cases for unused OrderdDict methods)? |
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ueno)
a discussion (no related file):
Previously, ueno (Daiki Ueno) wrote…
What do you expect to fix them: add compatibility with the legacy OrderdDict methods, or align to the dict (and remove test cases for unused OrderdDict methods)?
since the tests check if the code behaves as we need it to, I'd say that we should try to retain as much of them as possible
that being said, methods like itervalues
and iterkeys
are unused in tlsfuzzer code, so we can just skip those
fixing pop()
and popitem()
test case should be a simple case of not using a name for the argument
remember to rebase on top of master, there was a slight issue with py2.6 I had to fix to make the CI functional again |
8404a70
to
c41acb7
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.
Reviewed 1 of 1 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved
c41acb7
to
7055f04
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.
Reviewable status: 2 of 3 files reviewed, all discussions resolved (waiting on @tomato42)
a discussion (no related file):
Previously, tomato42 (Hubert Kario) wrote…
since the tests check if the code behaves as we need it to, I'd say that we should try to retain as much of them as possible
that being said, methods likeitervalues
anditerkeys
are unused in tlsfuzzer code, so we can just skip those
fixingpop()
andpopitem()
test case should be a simple case of not using a name for the argument
Sorry, I forgot the fact that OrderedDict
is a subclass of dict
and isinstance(d, dict)
cannot be used as a check. I've rewritten it with type(d) is dict
, which seems to work. Please check again.
tlsfuzzer/utils/ordered_dict.py, line 10 at r1 (raw file):
Previously, ueno (Daiki Ueno) wrote…
That's good; fixed.
Done.
Looks like we can't use the 3.7 implementation of the |
7055f04
to
f612c6e
Compare
f612c6e
to
fdd053a
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.
Reviewed 2 of 2 files at r4.
Reviewable status: complete! all files reviewed, all discussions resolved
thanks! |
Description
This makes
tlsfuzzer.utils.ordered_dict.OrderedDict
returndict
on Python 3.7, as suggested in #706.Motivation and Context
Fixes #706.
Checklist
tlslite-ng.json
andtlslite-ng-random-subset.json
This change is