BUG: Fix building under Python 3.

This commit is contained in:
Stefan van der Walt
2011-03-13 17:13:02 +02:00
parent ea3b46d80a
commit e45b6e0129
4 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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):
+6
View File
@@ -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},
)