From fb21d1ab49aa397531caa791bb6638b597cc26d5 Mon Sep 17 00:00:00 2001 From: Feei Date: Mon, 14 Aug 2017 17:01:03 +0800 Subject: [PATCH] fix Python3.x test.case --- cobra/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cobra/utils.py b/cobra/utils.py index 02c68b5b..5e1d18c8 100644 --- a/cobra/utils.py +++ b/cobra/utils.py @@ -271,8 +271,9 @@ def path_to_file(path): :return: """ paths = path.split('/') - paths = filter(None, paths) - return '.../{0}'.format(paths[len(paths) - 1]) + paths = list(filter(None, paths)) + length = len(paths) + return '.../{0}'.format(paths[length - 1]) def percent(part, whole, need_per=True):