Catch cPickle.PicklingError on python 2 (#191).

This commit is contained in:
Simon Conseil
2016-01-18 22:21:28 +01:00
parent 6a21251b56
commit b11cb28ff3
2 changed files with 7 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ if not PY2:
from http import server
from urllib.parse import quote as url_quote
import socketserver
import pickle
else:
text_type = unicode # NOQA
string_types = (str, unicode) # NOQA
@@ -46,6 +47,11 @@ else:
import SimpleHTTPServer as server # NOQA
import SocketServer as socketserver # NOQA
try:
import cPickle as pickle
except:
import pickle
class UnicodeMixin(object):
if not PY2:

View File

@@ -29,7 +29,6 @@ import fnmatch
import logging
import multiprocessing
import os
import pickle
import sys
import zipfile
@@ -40,7 +39,7 @@ from itertools import cycle
from os.path import isfile, join, splitext
from . import image, video, signals
from .compat import PY2, UnicodeMixin, strxfrm, url_quote, text_type
from .compat import PY2, UnicodeMixin, strxfrm, url_quote, text_type, pickle
from .image import process_image, get_exif_tags, get_exif_data, get_size
from .settings import get_thumb
from .utils import (Devnull, copy, check_or_create_dir, url_from_path,