summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNozomu Kaneko <nozom.kaneko@gmail.com>2012-12-15 16:06:20 +0900
committerNozomu Kaneko <nozom.kaneko@gmail.com>2012-12-15 16:06:20 +0900
commit18f66d7dd9cd4d9677d81b7f23f1771c0f334be2 (patch)
tree45da0fc473a092f06482ea4fbbb384cfd6873268
parent74a12600e91da74e5146ded11c2b21a65cd0254f (diff)
downloadsphinx-18f66d7dd9cd4d9677d81b7f23f1771c0f334be2.tar.gz
rather than use two-ifs, do it in one if-elif-else branch.
-rw-r--r--sphinx/ext/refcounting.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/sphinx/ext/refcounting.py b/sphinx/ext/refcounting.py
index 1d2a353a..c76d25d2 100644
--- a/sphinx/ext/refcounting.py
+++ b/sphinx/ext/refcounting.py
@@ -79,14 +79,12 @@ class Refcounts(dict):
continue
elif entry.result_type not in ("PyObject*", "PyVarObject*"):
continue
- rc = _('Return value: ')
if entry.result_refs is None:
- rc += _("Always NULL.")
+ rc = _('Return value: Always NULL.')
+ elif entry.result_refs:
+ rc = _('Return value: New reference.')
else:
- if entry.result_refs:
- rc += _("New reference.")
- else:
- rc += _("Borrowed reference.")
+ rc = _('Return value: Borrowed reference.')
node.insert(0, refcount(rc, rc))