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/docfields.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/docfields.py')
| -rw-r--r-- | sphinx/util/docfields.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sphinx/util/docfields.py b/sphinx/util/docfields.py index 150bf3a1a..e42d5c491 100644 --- a/sphinx/util/docfields.py +++ b/sphinx/util/docfields.py @@ -240,10 +240,8 @@ class DocFieldTransformer(object): if is_typefield: # filter out only inline nodes; others will result in invalid # markup being written out - content = filter( - lambda n: isinstance(n, nodes.Inline) or - isinstance(n, nodes.Text), - content) + content = [n for n in content if isinstance(n, nodes.Inline) or + isinstance(n, nodes.Text)] if content: types.setdefault(typename, {})[fieldarg] = content continue |
