diff options
| author | shimizukawa <shimizukawa@gmail.com> | 2014-05-01 20:14:19 +0900 |
|---|---|---|
| committer | shimizukawa <shimizukawa@gmail.com> | 2014-05-01 20:14:19 +0900 |
| commit | 6759ba4b68bda60626ebb1a69a0194de0b762485 (patch) | |
| tree | 46aa7e3ee51a8e1741006d1c218a07ce8c288eb6 /sphinx/ext | |
| parent | 8802cbe037c7b90d04220865aa376020360e6226 (diff) | |
| download | sphinx-6759ba4b68bda60626ebb1a69a0194de0b762485.tar.gz | |
delegate '__nonzero__' to '__bool__' for py2/py3 compatibility in one source. #1350
Diffstat (limited to 'sphinx/ext')
| -rw-r--r-- | sphinx/ext/autodoc.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 11b38d99..ab081097 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -54,9 +54,10 @@ class DefDict(dict): return dict.__getitem__(self, key) except KeyError: return self.default - def __nonzero__(self): + def __bool__(self): # docutils check "if option_spec" return True + __nonzero__ = __bool__ # for python2 compatibility identity = lambda x: x |
