From 485358469259203f9fbdcc9ac200e00cd4975756 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
Date: Tue, 12 Jan 2016 11:37:21 +0800
Subject: [PATCH] Use six.itervalues() in delete_media_files
---
mediagoblin/tools/files.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mediagoblin/tools/files.py b/mediagoblin/tools/files.py
index 848c86f..2c486ac 100644
a
|
b
|
|
14 | 14 | # You should have received a copy of the GNU Affero General Public License |
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | |
| 17 | import six |
| 18 | |
17 | 19 | from mediagoblin import mg_globals |
18 | 20 | |
19 | 21 | |
… |
… |
def delete_media_files(media):
|
25 | 27 | - media: A MediaEntry document |
26 | 28 | """ |
27 | 29 | no_such_files = [] |
28 | | for listpath in media.media_files.itervalues(): |
| 30 | for listpath in six.itervalues(media.media_files): |
29 | 31 | try: |
30 | 32 | mg_globals.public_store.delete_file( |
31 | 33 | listpath) |