Skip to content
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

Support Python 3 with "six" instead of running 2to3 #16

Merged
merged 1 commit into from
Jun 3, 2015

Conversation

cvubrugier
Copy link
Collaborator

  • Replace dict.iteritems() with six.iteritems(dict)
  • Use six.string_types instead of basestring
  • Remove calls to unicode() in the handle_input() function called by
    Urwid: it is not necessary. However, during my tests, I observed
    that the Urwid listbox displayed for cd is broken: I see garbage
    on the screen when moving the cursor.
  • Use six.moves to import pickle on Python 3 or cPickle on Python 2
  • Use six.moves to call input() on Python 3 or raw_input() on Python 2
  • Add classifiers to setup.py
  • Sort imports

Signed-off-by: Christophe Vu-Brugier cvubrugier@fastmail.fm

 * Replace dict.iteritems() with six.iteritems(dict)
 * Use six.string_types instead of basestring
 * Remove calls to unicode() in the handle_input() function called by
   Urwid: it is not necessary. However, during my tests, I observed
   that the Urwid listbox displayed for `cd` is broken: I see garbage
   on the screen when moving the cursor.
 * Use six.moves to import pickle on Python 3 or cPickle on Python 2
 * Use six.moves to call input() on Python 3 or raw_input() on Python 2
 * Add classifiers to setup.py
 * Sort imports

Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
@cvubrugier
Copy link
Collaborator Author

Hi Andy,

These changes are similar to what @Haypo did for rtslib-fb. I will also submit the changes for targetcli-fb as well.

@vstinner
Copy link

vstinner commented Jun 3, 2015

You can replace "import console" with "from . import console" to limit changes. But "from .console import symbol" works also. It's not a big deal :-)

agrover added a commit that referenced this pull request Jun 3, 2015
Support Python 3 with "six" instead of running `2to3`
@agrover agrover merged commit 33975c4 into open-iscsi:master Jun 3, 2015
@agrover
Copy link
Contributor

agrover commented Jun 3, 2015

great! thanks!

@cvubrugier cvubrugier deleted the python3-six branch June 4, 2015 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants