-
Notifications
You must be signed in to change notification settings - Fork 47
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
Clean up Python 2 styled code #97
Conversation
Since we only support Python 3, this is not needed any more.
Are these kind of cleanups worthwhile if we're trying to dissuade the use of paste? Also if we're trying to keep it as stable as possible, we want to change it as little as possible, don't we? If, on the other hand, we want to sort of bring it back to life, then these sorts of changes are warranted, but I don't know that we've made that decision. Are you interested in taking it in that direction? |
No, I don't want to bring it back to life. Just some cheap clean-up before this is retired for good. But you may decide. If you think it's not worthwile, just close this. Btw, I did some fixing/cleanup in PySourceColor, but noticed this code is broken and outdated. It contain bugs and code that cannot run in Python 3 (e.g. calls tokenize with a second parameter that only existed in Python2) , was written for Python 2 as input, and outputs XHTML instead of HTML5. The only really proper fix in my view would be to completely replace it with Pygments. If you think that is still worthwile, I would submit a PR, otherwise we need to leave it in this broken state. (update: see comment below) |
Looked a bit deeper and was able to fix the issue with the tokenizer. You can call the PySourceColor module on the command line to verify that it was broken before and now works (with the caveats mentioned above). This would make the module at least somewhat usable again, and keep things compatible without the need to switch to Pygments. So I think this whole PR is worthwile to merge. But will end working on paste after this. |
Btw, another cheap fix of broken Python 2 code is #68 - this is also worthwile to be fixed. |
nice work, thanks |
Some clean-up since paste only supports Python 3 nowadays: