Fixed exceptions, print statements, and long types for gen_pattern.py to be Python 3 compatible (#7994)
* fixed exceptions and print statements to be python 3 compatible; removed long type checks (py3 uses int); whitespace reformatting
* Pulled latest svgfig from upstream
f3179a8926