pep-8 formatting changes
replaced a print (python2) with warnings.warn
except Exception as (python 2.5+)