Closed DoctorLai closed 6 years ago
Account.has_voted() expects a Post(), not a string:
from steem.account import Account
from steem.post import Post
try:
account = Account("justyy")
if account.has_voted(Post("@justyy/cn--2017-11-17")):
print('voted already by has_voted')
except:
print("Unexpected error:", sys.exc_info()[0])
I am a fan of the steem-python library, and I think there is a bug in the has_voted method of the account class.
See this code:
Let's run it using
python3 test.py
assuming above script is saved totest.py
It will always throws the
unexpected error - attribute error
which basically makes the method unusable.The source code is at 136-138 of the official steem-python github page: https://github.com/steemit/steem-python/blob/master/steem/account.py
Open Source Contribution posted via Utopian.io