Migrate to Python 3#1
Conversation
| Alternatively, PyMoira has been packaged for Debian and Ubuntu. To | ||
| build the Debian package of the latest release, run:: | ||
|
|
||
| _(NOTE: deb generation is untested)_ |
| """ | ||
| if isinstance(s, str): | ||
| return s.encode() | ||
| else: |
There was a problem hiding this comment.
Remove the else and unindent the return s since you early-return on line 30
| _et_cache = {} | ||
|
|
||
|
|
||
| def _to_bytes(s): |
There was a problem hiding this comment.
I am not completely sure how necessary this function is, but doing .encode() instead of _to_bytes everywhere I used _to_bytes results in messages like AttributeError: 'bytes' object has no attribute 'encode'. Did you mean: 'decode'?.
There was a problem hiding this comment.
It looks like _to_bytes is basically coping with sometimes being passed a bytes and sometimes a string. If you need to handle that, I suspect you need something like _to_bytes, but if you can be consistent about "this function always takes a string" or "this function always takes bytes", you can just use .encode as needed.
It seems that "Implicit noexcept is deprecated in Cython 3.0"
This PR also migrates from the older Pyrex to the newer Cython. Also note that I have not touched the
debianbranch or tested.debgeneration, so it may need some tweaking.