diff --git a/django/db/models/query.py b/django/db/models/query.py index a8ab94d013..fa3969ecfc 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -195,10 +195,7 @@ class QuerySet(object): ################################################## def in_bulk(self, id_list): - try: - iter(id_list) - except TypeError: - assert False, "in_bulk() must be provided with a list of IDs." + assert isinstance(id_list, (tuple, list)), "in_bulk() must be provided with a list of IDs." id_list = list(id_list) assert id_list != [], "in_bulk() cannot be passed an empty ID list." return self._clone(klass=InBulkQuerySet, _id_list=id_list)