mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-05 08:31:31 +08:00
BUG: Fix building under Python 3.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user