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

PY_MAJOR_VERSION > 3 #351

Open
injust opened this issue May 14, 2024 · 1 comment
Open

PY_MAJOR_VERSION > 3 #351

injust opened this issue May 14, 2024 · 1 comment
Labels

Comments

@injust
Copy link

injust commented May 14, 2024

Is PY_MAJOR_VERSION > 3 correct here? Shouldn't it be >= 3 instead?

cdef bytes _b(s):
if PY_MAJOR_VERSION > 3:
if isinstance(s, str):
return s.encode('UTF-8')
elif isinstance(s, unicode):
return s.encode('UTF-8')
return s

@sirfz sirfz added the bug label May 14, 2024
@sirfz
Copy link
Owner

sirfz commented May 14, 2024

That's a good spot, I guess Cython interprets unicode as str in Python 3 anyway so this was never an issue.

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

No branches or pull requests

2 participants