mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-03-16 21:30:23 +00:00
Move force_bytes into lib module
This commit is contained in:
parent
c1e16696b1
commit
87983c5e6d
2 changed files with 8 additions and 9 deletions
|
|
@ -41,10 +41,13 @@ except ImportError:
|
|||
# It is used for compatibility between Python 2 and Python 3
|
||||
# NOTE: I'm not sure if this is the right place. Maybe this can be in `utils`.
|
||||
try:
|
||||
from django.utils.encoding import force_text, smart_text
|
||||
from django.utils.encoding import force_text, force_bytes, smart_text
|
||||
except ImportError:
|
||||
# Django < 1.5
|
||||
from django.utils.encoding import force_unicode as force_text, smart_unicode as smart_text
|
||||
from django.utils.encoding import (force_unicode as force_text,
|
||||
smart_str as force_bytes,
|
||||
smart_unicode as smart_text)
|
||||
|
||||
__all__ = ['Image', 'ImageColor', 'ImageChops', 'ImageEnhance', 'ImageFile', 'ImageFilter',
|
||||
'ImageDraw', 'ImageStat', 'StringIO', 'NullHandler', 'force_text', 'smart_text']
|
||||
__all__ = ['Image', 'ImageColor', 'ImageChops', 'ImageEnhance', 'ImageFile',
|
||||
'ImageFilter', 'ImageDraw', 'ImageStat', 'StringIO', 'NullHandler',
|
||||
'force_text', 'force_bytes', 'smart_text']
|
||||
|
|
|
|||
|
|
@ -8,12 +8,8 @@ from django.conf import settings
|
|||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.core.files import File
|
||||
from django.utils.importlib import import_module
|
||||
try:
|
||||
from django.utils.encoding import force_bytes
|
||||
except ImportError:
|
||||
from django.utils.encoding import smart_str as force_bytes
|
||||
from pilkit.utils import *
|
||||
from .lib import NullHandler
|
||||
from .lib import NullHandler, force_bytes
|
||||
|
||||
|
||||
bad_memcached_key_chars = re.compile('[\u0000-\u001f\\s]+')
|
||||
|
|
|
|||
Loading…
Reference in a new issue