Closed WnP closed 9 years ago
@WnP thanks for the pull request!
I'm going to make some minor line comments in a moment but, as someone not super familiar with the changes between Python 2.7 and Python 3.3 // 3.4, I'd like a more detailed explanation of why these changes are necessary for forward-compatibility before I merge this pull request or evaluate it in detail.
Thanks!
for the first commit 88e2ecd this answer on stackoverflow should help you to understand the problem
for the second commit 1829ed8 this other answer on SO should help
Re. commit 88e2ecd
@WnP I'm testing on python 2.7.6, and I'm getting an error:
File "stackit/stackit_core.py", line 210, in <module>
main()
File "stackit/stackit_core.py", line 199, in main
term = getTerm(parser)
File "stackit/stackit_core.py", line 135, in getTerm
term += (output.splitlines()[-1] + bytes(" ", "ascii"))
TypeError: str() takes at most 1 argument (2 given)
And accoding to this SO thread that makes sense––bytes
functions like string
and does not take encoding as an argument.
Maybe add a condition that checks the python version? I can't merge this as is.
@lukasschwab fixed
Looks great, problem solved! Merging + adding README credits
Tested on python3.4 and python2.7.9