I have a python package which was developed under python2.7, but I need to port it to python3.6 . I use cython in some parts of the code, hence the package has both .py
and .pyx
files.
I tried the 2to3
command, but I got an error that I couldn't neither understand nor solve.
Example: I have the following test.pyx
file
# cython: profile=False
cimport cython
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.profile(False)
cpdef sillyfunction():
print 'Thank you for your kind help'
return
and I run 2to3 test.pyx
. What I obtain is:
user@machine:~$ 2to3 test.pyx
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Can't parse test.pyx: ParseError: bad input: type=1, value=u'cython', context=(u' ', (2, 8))
RefactoringTool: No files need to be modified.
RefactoringTool: There was 1 error:
RefactoringTool: Can't parse test.pyx: ParseError: bad input: type=1, value=u'cython', context=(u' ', (2, 8))