Make code 2.7+ compatible.