diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2014-01-19 14:17:10 +0400 |
---|---|---|
committer | Dmitry Shachnev <mitya57@gmail.com> | 2014-01-19 14:17:10 +0400 |
commit | ce2185ce279664e54ba22b14663091abc5a3a8f2 (patch) | |
tree | 97b00b55be0e28a73399acc0f80e21e6a4e24b28 /sphinx/util/pycompat.py | |
parent | fa9695dbe0b090eb9907647b7a8d1c20210efa5b (diff) | |
download | sphinx-git-ce2185ce279664e54ba22b14663091abc5a3a8f2.tar.gz |
Modernize the code now that Python 2.5 is no longer supported
- Use print function instead of print statement;
- Use new exception handling;
- Use in operator instead of has_key();
- Do not use tuple arguments in functions;
- Other miscellaneous improvements.
This is based on output of `futurize --stage1`, with some
manual corrections.
Diffstat (limited to 'sphinx/util/pycompat.py')
-rw-r--r-- | sphinx/util/pycompat.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py index 9941dc0c0..4c9ef18d3 100644 --- a/sphinx/util/pycompat.py +++ b/sphinx/util/pycompat.py @@ -41,7 +41,7 @@ if sys.version_info >= (3, 0): source = refactoring_tool._read_python_source(filepath)[0] try: tree = refactoring_tool.refactor_string(source, 'conf.py') - except ParseError, err: + except ParseError as err: # do not propagate lib2to3 exceptions lineno, offset = err.context[1] # try to match ParseError details with SyntaxError details |