-
Notifications
You must be signed in to change notification settings - Fork 10
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
Catch up py3k support #21
Conversation
You didn't mean to use the buffer builtin there. Going from the C implementation, the expected thing to do here is limit the chunk size.
With an integer argument
def chr_(o): | ||
if sys.version_info >= (3, 0, 0): | ||
return bytes((o,)) | ||
return chr(o) |
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.
Should this not rather be:
if sys.version_info >= (3, 0, 0):
def chr_(o):
return bytes((o,))
else:
chr_ = chr
Left one niggly stylistic comment, otherwise 👍. |
@@ -49,13 +51,14 @@ def save(surface, filename): | |||
fn_normalized = filename.lower() | |||
result = 0 | |||
# TODO: prep/unprep surface | |||
if fn_normalized.endswith('bmp'): | |||
if fn_normalized.endswith(as_bytes('bmp')): |
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.
Do we really need as_bytes here?
Don't we only support recent enough python 2 versions that we can just use b'bmp'?
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.
That was my first approach. But then I saw that we had as_bytes
for this. I'm happy to remove as_bytes
entirely.
We don't support Python 2.6 or 3.2, any more.
👍 |
Python 3 support has been neglected for a while. This gets all the upstream unit tests that pass on Python 2, to pass on Python 3.