Ticket #5387: 0001-Use-six.itervalues-in-delete_media_files.patch

File 0001-Use-six.itervalues-in-delete_media_files.patch, 1.0 KB (added by 宋文武, 9 years ago)
  • mediagoblin/tools/files.py

    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  
    1414# You should have received a copy of the GNU Affero General Public License
    1515# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1616
     17import six
     18
    1719from mediagoblin import mg_globals
    1820
    1921
    def delete_media_files(media):  
    2527     - media: A MediaEntry document
    2628    """
    2729    no_such_files = []
    28     for listpath in media.media_files.itervalues():
     30    for listpath in six.itervalues(media.media_files):
    2931        try:
    3032            mg_globals.public_store.delete_file(
    3133                listpath)