Skip to content
Stuart Mumford edited this page Oct 31, 2013 · 5 revisions

Notes on the refactor to 3.3:

future imports from http://docs.astropy.org/en/latest/development/codeguide.html#welcome-to-the-future

using: find . -name "*.py" -print | xargs sed -i 's/from future import absolute_import/from future import absolute_import, division, print_function, unicode_literals/g'

then run some 2to3:

2to3 -f basestring -f dict -f except -f has_key -f idioms -f imports -f itertools -f itertools_imports -f unicode -f xrange

like:

find sunpy/ -name "*.py" -exec 2to3 -w -n -f basestring -f dict -f except -f has_key -f idioms -f imports -f itertools -f itertools_imports -f unicode -f xrange {} ;

Clone this wiki locally