Skip to content
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

deps(python): Python 2 -> 3 by hand #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Et7f3
Copy link

@Et7f3 Et7f3 commented Apr 9, 2022

fix #17

Copy link
Author

@Et7f3 Et7f3 left a comment

Choose a reason for hiding this comment

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

And the rest should be only print.

return hashlib.sha256(hashData).hexdigest()
return hashlib.sha256(hashData.encode("utf8")).hexdigest()
Copy link
Author

Choose a reason for hiding this comment

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

should be ok.

dataFile = file("chain.txt", "w")
dataFile = open("chain.txt", "w")
Copy link
Author

Choose a reason for hiding this comment

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

cmd = raw_input("[BlockShell] $ ")
cmd = input("[BlockShell] $ ")
Copy link
Author

Choose a reason for hiding this comment

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

@Et7f3
Copy link
Author

Et7f3 commented Apr 9, 2022

#18 did the work (work for py2 and py3) and was rejected. Maybe for raw_input hack. I followed official recommandation so I hope it will be merged. Also python2 is really old and even Debian install python3 as default and python2 as option.


def mineBlock(self, difficulty):
"""
Method for Proof of Work
"""
print Back.RED + "\n[Status] Mining block (" + str(self.index) + ") with PoW ..."
print(Back.RED + "\n[Status] Mining block (" + str(self.index) + ") with PoW ...")

Choose a reason for hiding this comment

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

probably use fstrings. Since this is cli we should use click and show messages with click.echo

Copy link
Author

Choose a reason for hiding this comment

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

I opted for minimal change. If we are ok about putting 3.6 as lower bound why not.

Choose a reason for hiding this comment

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

but I agree this doesn't block your PR

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.

Python 3 version
2 participants