Closed Mome closed 2 years ago
I was getting an error when I tried to run pdir on classes from a jar-file wrapped with jpype:
~/.local/lib/python3.9/site-packages/pdir/api.py in get_oneline_doc(self) 205 return ', '.join(doc_list) 206 --> 207 if hasattr(attr, '__doc__'): 208 doc = inspect.getdoc(attr) 209 return doc.split('\n', 1)[0] if doc else '' # default doc is None ~/.local/lib/python3.9/site-packages/jpype/_jclass.py in _jclassDoc(cls) 162 if not hasattr(cls, "__javadoc__"): 163 jde = JClass("org.jpype.javadoc.JavadocExtractor")() --> 164 jd = jde.getDocumentation(cls) 165 if jd is not None: 166 setattr(cls, "__javadoc__", jd) SystemError: Fail in conversion
In this fix I simply set an empty doc if an Exception occurs calling hasattr.
hasattr
Hi, Thanks for the PR! Could you add a test case for it?
Was not so easy to fabricate the problem, but I guess that's a proper test case.
Thanks!
I was getting an error when I tried to run pdir on classes from a jar-file wrapped with jpype:
In this fix I simply set an empty doc if an Exception occurs calling
hasattr
.