Skip to content

Support Python 3#19

Merged
tedivm merged 4 commits into
screepers:masterfrom
Dessix:python3
Aug 26, 2017
Merged

Support Python 3#19
tedivm merged 4 commits into
screepers:masterfrom
Dessix:python3

Conversation

@Dessix

@Dessix Dessix commented Aug 7, 2017

Copy link
Copy Markdown
Contributor

Fixes compatibility with Python 3 to allow it to properly behave as Python 2 does.

Requires completion of Python Screeps PR #22 to function on Python 3.

Dessix added 4 commits August 6, 2017 22:33
Requirements.txt now includes the newer websocket and requests versions for use
with the api code.

# If we lose the connection to the remote system close the console.
if data.startswith('### closed ###'):
if data.startswith(b'### closed ###'):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the point of turning these into "bytes" instead of just strings? You do it in some other areas as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

data is a byte array, in Python 3. startswith will throw on mismatched types.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, that makes sense.

@tedivm tedivm merged commit b63ba28 into screepers:master Aug 26, 2017
@Dessix Dessix deleted the python3 branch August 26, 2017 18:40
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.

2 participants