I'm not sure you need to do something as memory-intensive as import numpy just to raise a simple AttributeError, but I'm sure it does work.