Make backwards compatible with 2.7/3.0/3.1