Skip to content

Commit 63e312a

Browse files
speleo3JarrettSJohnson
authored andcommitted
Fix PytestUnraisableExceptionWarning
pytest reports a warning in tests/api/build.py::TestNucBuilder AttributeError: 'Indexed' object has no attribute 'molecule' Since 'molecule' seems to be an optional member of the chempy Indexed object, the AttributeError can be deliberately ignored.
1 parent 9375fd2 commit 63e312a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

layer2/ObjectMolecule.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7252,6 +7252,8 @@ ObjectMolecule *ObjectMoleculeLoadChemPyModel(PyMOLGlobals * G,
72527252
}
72537253
}
72547254
Py_DECREF(mol);
7255+
} else if (PyErr_Occurred() == PyExc_AttributeError) {
7256+
PyErr_Clear();
72557257
}
72567258
if(PyObject_HasAttrString(model, "spheroid") &&
72577259
PyObject_HasAttrString(model, "spheroid_normals")) {

0 commit comments

Comments
 (0)