fix python3 depreciation warnings