visit: CLI: `dir` is broken for State attributes (python 3.9.18)

Describe the bug

Run visit -cli -nowin

>>> dir(PseudcolorAttributes())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'PseudcolorAttributes' is not defined
>>> dir(PseudocolorAttributes())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Could not find method with name `__class__`

Adding an or-clause to https://github.com/visit-dav/visit/blob/8f22a451d678cb51ad0cb1657f0225cc8f482287/src/plots/Pseudocolor/PyPseudocolorAttributes.C#L3950 to also test for __class__ seems to work in the small test I performed.

Is this the right solution?

It would need to be applied to all state objects that have python interface.

Desktop

  • OS and version: tested on Windows, Linux
  • VisIt Version: 3.4.1/develop
  • Server info (if applicable):

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (18 by maintainers)

Commits related to this issue

Most upvoted comments

to be clear, you don’t have to explore removing fully, but we should as a team

We are no longer building with python2 anywhere.

We need to implement tp_getattro for python3. Its a simple fix. I am testing on PseudocolorAttributes()