account.has_voted throws AttributeErrorsteemCreated with Sketch.

in #utopian-io7 years ago (edited)

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:

from steem.account import Account
import sys

try:
  account = Account("justyy")
  if account.has_voted("@justyy/cn--2017-11-17"):
    print('voted already by has_voted')
except:
  print("Unexpected error:", sys.exc_info()[0])    

Let's run it using python3 test.py assuming above script is saved to test.py

It will always throws the unexpected error - attribute error which basically makes the method unusable.

image.png

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

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Thank you, that is super efficient!

Hey @justyy I am @utopian-io. I have just upvoted you at 15% Power!

Achievements

  • Seems like you contribute quite often. AMAZING!

Did you know?

  • I am going to become the first Steem Community-Driven Witness. Follow me to know when!
    Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.029
BTC 67831.26
ETH 3460.55
USDT 1.00
SBD 2.72