Catch AttributeError on captureWarnings usage.