PY2TO3: Changed quad.py to be python 3 compatible.