Skip to content

Support python3 < 3.4.2#4

Open
claws wants to merge 1 commit into
lisael:masterfrom
claws:support_older_py3
Open

Support python3 < 3.4.2#4
claws wants to merge 1 commit into
lisael:masterfrom
claws:support_older_py3

Conversation

@claws

@claws claws commented Jan 23, 2015

Copy link
Copy Markdown

This pull request slightly modifies the implementation so that Python3 versions older than 3.4.2 can use this library. The loop.create_task is only available in 3.4.2 and as indicated here https://docs.python.org/3/library/asyncio-eventloop.html#coroutines the way to support older versions is by using asyncio.async.

I was running a stand alone etcd instance and when running the simple_client.py the leader function would return 404 page not found. This seems to be the case when running etcd stand alone as I get the same thing when going directly to etcd.

$ curl -L http://127.0.0.1:4001/v2/leader
404 page not found

I've added a change so that the leader function will return the leader or None.

I have also added a simple __str__ to the Node class so that the simple_client.py script can display some meaningful information when it does print(result). So now instead of seeing:

client_get
<aioetcd.FileNode object at 0x7f8a12879550>

it will show:

client_get
key=/hello, value=43, expiration=None, ttl=None, raft_index=6740

@lisael

lisael commented Jan 29, 2015

Copy link
Copy Markdown
Owner

Seems good. I'd like to test it on travis with a python < 3.4.2 before i merge. Thank you

@claws

claws commented May 20, 2015

Copy link
Copy Markdown
Author

Any chance you were going to pull this request? I ask because I have had someone send me a pull request for additional changes because my fork is now leading yours. I also have a few fixes of my own to push too.

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