From 286e0902b87cd0380bc0b256e1a36dd295fc3bab Mon Sep 17 00:00:00 2001 From: Alexey Baranov Date: Sun, 19 Mar 2017 15:43:05 +0300 Subject: [PATCH] UPD managers.py Python 3 compatibility. basestring -> six.string_types --- django_elasticsearch/managers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django_elasticsearch/managers.py b/django_elasticsearch/managers.py index edf2718..e918953 100644 --- a/django_elasticsearch/managers.py +++ b/django_elasticsearch/managers.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import json +import six try: import importlib except ImportError: # python < 2.7 @@ -87,7 +88,7 @@ def check_cluster(self): def get_serializer(self, **kwargs): serializer = self.model.Elasticsearch.serializer_class - if isinstance(serializer, basestring): + if isinstance(serializer, six.string_types): module, kls = self.model.Elasticsearch.serializer_class.rsplit(".", 1) mod = importlib.import_module(module) return getattr(mod, kls)(self.model, **kwargs)