-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to Python 3 #1
base: master
Are you sure you want to change the base?
Conversation
@@ -27,6 +27,8 @@ working directory is the root of the PyMoira source tree. | |||
Alternatively, PyMoira has been packaged for Debian and Ubuntu. To | |||
build the Debian package of the latest release, run:: | |||
|
|||
_(NOTE: deb generation is untested)_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test it?
moira.py
Outdated
""" | ||
if isinstance(s, str): | ||
return s.encode() | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the else and unindent the return s
since you early-return on line 30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -23,6 +23,15 @@ | |||
_et_cache = {} | |||
|
|||
|
|||
def _to_bytes(s): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'?
.
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
debian
branch or tested.deb
generation, so it may need some tweaking.