Run 2to3.

This commit is contained in:
Ryan Stein 2017-10-29 13:40:30 -04:00
parent a5a8d9dd57
commit 6fa280b9fd
157 changed files with 976 additions and 976 deletions

View file

@ -6,7 +6,7 @@ leave caching unexpectedly (no use of WeakRefs).
Also adds `cache_size()` for monitoring the size of the cache.
"""
from __future__ import absolute_import, division
from builtins import object
from future.utils import listitems, listvalues, with_metaclass
@ -141,7 +141,7 @@ class SharedMemoryModelBase(ModelBase):
"Setter only used on foreign key relations, allows setting with #dbref"
if _GA(cls, "_is_deleted"):
raise ObjectDoesNotExist("Cannot set %s to %s: Hosting object was already deleted!" % (fname, value))
if isinstance(value, (basestring, int)):
if isinstance(value, (str, int)):
value = to_str(value, force_string=True)
if (value.isdigit() or value.startswith("#")):
# we also allow setting using dbrefs, if so we try to load the matching object.
@ -328,7 +328,7 @@ class SharedMemoryModel(with_metaclass(SharedMemoryModelBase, Model)):
if force:
cls.__dbclass__.__instance_cache__ = {}
else:
cls.__dbclass__.__instance_cache__ = dict((key, obj) for key, obj in cls.__dbclass__.__instance_cache__.items()
cls.__dbclass__.__instance_cache__ = dict((key, obj) for key, obj in list(cls.__dbclass__.__instance_cache__.items())
if not obj.at_idmapper_flush())
#flush_instance_cache = classmethod(flush_instance_cache)