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
Remove Python 2-only code #875
Conversation
@@ -103,7 +102,7 @@ def __init__(cls, name, bases, clsdict): | |||
cls._classinit() | |||
|
|||
|
|||
class NodeHandler(with_metaclass(MetaHelper, object)): | |||
class NodeHandler(metaclass=MetaHelper): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Yes, this is correct. You don't need to explicit subclass object
in Python 3 as discussed here.
'logging.exception' will log the stacktrace of an exception automatically. You need to provide the message. In addition, all 'logging' calls require an argument. Resolve both issues. Signed-off-by: Stephen Finucane <stephen@that.guru>
The vendored 'rst2pdf.rson' module provides a number of factory methods. Many of these factory methods provide the ability to override Python builtins by passing arguments, e.g.: Tokenizer.factory(len=some_other_len_function) We weren't using any of this functionality, which means it's unnecessary complexity that should be removed. Do just that. Signed-off-by: Stephen Finucane <stephen@that.guru>
We not longer need to switch between unicode and str or basetring and str depending on whether we're Python 2 or Python 3 respectively. Just use 'str' everywhere. Signed-off-by: Stephen Finucane <stephen@that.guru>
This is unnecessary complexity now.
Each of these are the defaults in Python 3.x. Signed-off-by: Stephen Finucane <stephen@that.guru>
8ff20d1
to
c264a6e
Compare
Resolved the conflicts due to the now-merged #841 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests pass and it the diff looks plausible :)
This depends on #841. Remove six, unnecessary future imports, and code that is only used under the now-unsupported Python 2.7 environment.