I know this isn't new code in this commit, but I couldn't help but notice that this should be a ValueError, not an AttributeError. http://docs.python.org/2/library/exceptions.html