Skip to content
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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Migrate to Python 3 #1

wants to merge 5 commits into from

Conversation

gabrc52
Copy link

@gabrc52 gabrc52 commented Mar 30, 2023

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.

@@ -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)_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test it?

_moira.pyx Outdated Show resolved Hide resolved
moira.py Outdated Show resolved Hide resolved
moira.py Outdated
"""
if isinstance(s, str):
return s.encode()
else:
Copy link
Member

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

moira.py Outdated Show resolved Hide resolved
moira.py Outdated Show resolved Hide resolved
_moira.pyx Outdated Show resolved Hide resolved
@gabrc52 gabrc52 marked this pull request as draft March 30, 2023 05:31
@@ -23,6 +23,15 @@
_et_cache = {}


def _to_bytes(s):
Copy link
Author

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'?.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants