Skip to content

sphinxext py3 compatibility #5530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
listcomp -> for-loop (listcopms create a new scope in py3), bypass At…
…tributeError on Pandas.str
  • Loading branch information
metakermit committed Jan 29, 2014
commit 026c9be691bc5abb3997325ae483adccd7158f2c
12 changes: 8 additions & 4 deletions doc/sphinxext/numpydoc/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,14 @@ def splitlines_x(s):
for field, items in [('Methods', self.methods),
('Attributes', self.properties)]:
if not self[field]:
self[field] = [
(name, '',
splitlines_x(pydoc.getdoc(getattr(self._cls, name))))
for name in sorted(items)]
doc_list = []
for name in sorted(items):
try:
doc_item = pydoc.getdoc(getattr(self._cls, name))
doc_list.append((name, '', splitlines_x(doc_item)))
except AttributeError:
pass # method doesn't exist
self[field] = doc_list

@property
def methods(self):
Expand Down