#Check for non-manifold geometry
def checkNonManifold(object, chk):
curSel = cmds.ls(sl=True)
#checkNMG = cmds.polyInfo(nonManifoldVertices=True, laminaFaces=True, nonManifoldEdges=True) # <---My initial solution, but not ideal because it doesn't catch all the issues.
checkNMG = mel.eval('polyCleanupArgList 3 { "0","2","1","0","1","1","1","0","0","1e-005","1","1e-005","1","1e-005","0","1","1" };') # <----Here is the problem
if chk == 7:
if len(checkNMG) > 0: checkFail(object, chk)
cmds.selectMode(object=True)
cmds.select(curSel)