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 | 344417db950d6e816ab2efb21737c2bdf9d1ad53 (patch) | |
| tree | 97b00b55be0e28a73399acc0f80e21e6a4e24b28 /sphinx/util/docstrings.py | |
| parent | 59b355edaa4f17aff910bf2371526d5ce46fb648 (diff) | |
| download | sphinx-344417db950d6e816ab2efb21737c2bdf9d1ad53.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/docstrings.py')
| -rw-r--r-- | sphinx/util/docstrings.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/util/docstrings.py b/sphinx/util/docstrings.py index d45b938d..97303bd7 100644 --- a/sphinx/util/docstrings.py +++ b/sphinx/util/docstrings.py @@ -23,7 +23,7 @@ def prepare_docstring(s, ignore=1): """ lines = s.expandtabs().splitlines() # Find minimum indentation of any non-blank lines after ignored lines. - margin = sys.maxint + margin = sys.maxsize for line in lines[ignore:]: content = len(line.lstrip()) if content: @@ -33,7 +33,7 @@ def prepare_docstring(s, ignore=1): for i in range(ignore): if i < len(lines): lines[i] = lines[i].lstrip() - if margin < sys.maxint: + if margin < sys.maxsize: for i in range(ignore, len(lines)): lines[i] = lines[i][margin:] # Remove any leading blank lines. while lines and not lines[0]: |
