[anaconda][master][PATCH 0/9] More Python 3 compatibility

Vratislav Podzimek vpodzime at redhat.com
Thu Jan 29 08:10:24 UTC 2015


On Wed, 2015-01-28 at 18:43 +0100, Martin Kolman wrote:
> Most of the easy to change, non-invasive Python 3 compatibility
> changes have been done a while ago. This patch set contains more
> complicated and invasive changes, but still without breaking Python 2
> support.
> 
> Also while working on the patch set I've made a preliminary list of
> the *invasive* changes that *do* break Python 2 compatibility,
> but are needed to make Anaconda Python 3 compatible:
> 
> - switch to Python 3 versions of dependencies in spec file
> - switch to use python3 in the main anaconda script:
>  - #!/usr/bin/python3
> - replace types.StringType with str or bytes (depending on data being processed)
> - replace types.UnicodeType with str
> - replace all unicode() calls with str()
> - import Queue -> import queue
> - import ConfigParser -> import configparser
> - remove from __future__ import print_function
> - adapt metaclass usage
>  - 2to3 -f metaclass .
> - replace xrange with range
> - replace next() with __next__() for custom iterators
Huh? Do you mean the .next() method? Because AFAICT, next(itr) is the
recommended way to work with iterators in Python3.

> - replace raw_input() with input()
> 
> These two together + dropping of the few remaining Python 2-only dependencies
> (pyblock, something else ?) should more or less give us a Python 3 Anaconda.
That doesn't seem too bad to me. Thanks for the report!

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list