Fix test_pipeline_sort for python3.