compatibility try except clause for CentOS 6