-
Notifications
You must be signed in to change notification settings - Fork 517
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 Python2 hybridation code #2540
base: master
Are you sure you want to change the base?
Conversation
samples/printing/printing.py
Outdated
@@ -1,5 +1,6 @@ | |||
from __future__ import print_function |
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.
Probably don't need this...we can drop support for Python 2.
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.
so let's remove all six
usage ?
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.
... and the vendored copy living as wx/lib/pubsub/py2and3.py
@@ -550,7 +549,7 @@ def __init__(self, parent): | |||
IL_VARIABLE_SIZE = 1 | |||
|
|||
# Python integers, to make long types to work with CreateListItem | |||
INTEGER_TYPES = six.integer_types | |||
INTEGER_TYPES = int |
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.
This is changing the value from a list to a scalar value which is now causing crashes later on in the source. I converted all in INTEGER_TYPES
to == INTEGER_TYPES
and it fixed it. Should probably update the name to reflect the change as well.
if type(itemOrId) in INTEGER_TYPES:
< line 598
Another example:
"""
A list event holds information about events associated with :class:`UltimateListCtrl`
objects.
"""
def __init__(self, commandTypeOrEvent=None, winid=0):
"""
Default class constructor.
For internal use: do not call it in your code!
:param `commandTypeOrEvent`: the event type or another instance of
:class:`PyCommandEvent`;
:param `winid`: the event identifier.
"""
if type(commandTypeOrEvent) in INTEGER_TYPES:
Thanks for the review
The right thing to do is to get rid of INTEGER_TYPES altogether:
```
-if type(commandTypeOrEvent) in INTEGER_TYPES:
+if isintance(commandTypeOrEvent, int):
```
|
I agree with this PR. I also agree with removing all |
I agree with dropping support for Python 2.
|
I m on Holliday. Anyone can cherrypick the first commit that removes py2.6< compatibility if it tastes them, |
At first there was only this one first commit untill I got asked to proceed further |
Please merge. |
The PR against GRASS (which uses Wx by the way) had a similar +/- size and went in smoothly. I m not scared. What do we need to go further ? |
print()
is available since Python 2.6https://wiki.debian.org/Python3-six-removal