diff --git a/scikits/image/__init__.py b/scikits/image/__init__.py index 9cc4edc5..4c539c41 100644 --- a/scikits/image/__init__.py +++ b/scikits/image/__init__.py @@ -16,7 +16,7 @@ def _setup_test(): try: import nose as _nose except ImportError: - print "Could not load nose. Unit tests not available." + print("Could not load nose. Unit tests not available.") return None else: return functools.partial(_nose.run, 'scikits.image', argv=args) diff --git a/scikits/image/_build.py b/scikits/image/_build.py index f124ab9f..eb56edf3 100644 --- a/scikits/image/_build.py +++ b/scikits/image/_build.py @@ -27,7 +27,7 @@ def cython(pyx_files, working_path=''): # run cython compiler cmd = 'cython -o %s %s' % (c_file_new, pyxfile) - print cmd + print(cmd) if platform.system() == 'Windows': status = subprocess.call( @@ -41,8 +41,8 @@ def cython(pyx_files, working_path=''): # if the resulting file is small, cython compilation failed if status != 0 or os.path.getsize(c_file_new) < 100: - print "Cython compilation of %s failed. Falling back " \ - "on pre-generated file." % os.path.basename(pyxfile) + print("Cython compilation of %s failed. Falling back " \ + "on pre-generated file." % os.path.basename(pyxfile)) elif not same_cython(c_file_new, c_file): # if the generated .c file differs from the one provided, # use that one instead diff --git a/scikits/image/io/tests/test_plugin.py b/scikits/image/io/tests/test_plugin.py index 02e953d7..d4955397 100644 --- a/scikits/image/io/tests/test_plugin.py +++ b/scikits/image/io/tests/test_plugin.py @@ -37,12 +37,12 @@ class TestPlugin: def test_use_priority(self): plugin.use('pil') plug, func = plugin.plugin_store['imread'][0] - print plugin.plugin_store + print(plugin.plugin_store) assert_equal(plug, 'pil') plugin.use('test') plug, func = plugin.plugin_store['imread'][0] - print plugin.plugin_store + print(plugin.plugin_store) assert_equal(plug, 'test') def test_available(self): diff --git a/setup.py b/setup.py index 14cac296..ac509648 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,10 @@ VERSION = '0.3dev' import os import setuptools from numpy.distutils.core import setup +try: + from distutils.command.build_py import build_py_2to3 as build_py +except ImportError: + from distutils.command.build_py import build_py def configuration(parent_package='', top_path=None): if os.path.exists('MANIFEST'): os.remove('MANIFEST') @@ -89,4 +93,6 @@ if __name__ == "__main__": 'console_scripts': [ 'scivi = scikits.image.scripts.scivi:main'] }, + + cmdclass={'build_py': build_py}, )