Don't use long, since it doesn't exist in python3.

This commit is contained in:
Ahmed Charles 2015-10-23 04:20:56 +00:00 committed by Griatch
parent 11b61fe335
commit c9404bfb51
2 changed files with 7 additions and 5 deletions

View file

@ -9,6 +9,7 @@ from django.db.models.fields import exceptions
from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
from evennia.typeclasses.managers import returns_typeclass, returns_typeclass_list
from evennia.utils.utils import to_unicode, is_iter, make_iter, string_partial_matching
from builtins import int
__all__ = ("ObjectManager",)
_GA = object.__getattribute__
@ -149,7 +150,7 @@ class ObjectDBManager(TypedObjectManager):
## This doesn't work if attribute_value is an object. Workaround below
if isinstance(attribute_value, (basestring, int, float, bool, long)):
if isinstance(attribute_value, (basestring, int, float, bool)):
return self.filter(cand_restriction & type_restriction & Q(db_attributes__db_key=attribute_name, db_attributes__db_value=attribute_value))
else:
# We have to loop for safety since the referenced lookup gives deepcopy error if attribute value is an object.

View file

@ -31,6 +31,7 @@ from django.contrib.contenttypes.models import ContentType
from evennia.server.models import ServerConfig
from evennia.utils.utils import to_str, uses_database
from evennia.utils import logger
from builtins import int
__all__ = ("to_pickle", "from_pickle", "do_pickle", "do_unpickle")
@ -121,7 +122,7 @@ class _SaverMutable(object):
def process_tree(item, parent):
"recursively populate the tree, storing parents"
dtype = type(item)
if dtype in (basestring, int, long, float, bool, tuple):
if dtype in (basestring, int, float, bool, tuple):
return item
elif dtype == list:
dat = _SaverList(parent=parent)
@ -280,7 +281,7 @@ def to_pickle(data):
def process_item(item):
"Recursive processor and identification of data"
dtype = type(item)
if dtype in (basestring, int, long, float, bool):
if dtype in (basestring, int, float, bool):
return item
elif dtype == tuple:
return tuple(process_item(val) for val in item)
@ -325,7 +326,7 @@ def from_pickle(data, db_obj=None):
def process_item(item):
"Recursive processor and identification of data"
dtype = type(item)
if dtype in (basestring, int, long, float, bool):
if dtype in (basestring, int, float, bool):
return item
elif _IS_PACKED_DBOBJ(item):
# this must be checked before tuple
@ -348,7 +349,7 @@ def from_pickle(data, db_obj=None):
def process_tree(item, parent):
"Recursive processor, building a parent-tree from iterable data"
dtype = type(item)
if dtype in (basestring, int, long, float, bool):
if dtype in (basestring, int, float, bool):
return item
elif _IS_PACKED_DBOBJ(item):
# this must be checked before tuple