Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # [11:58 PM] Tavis: Hello I am getting a really odd error here...
- # I have an example class like so:
- class Test:
- __conditionname__ = "example"
- def __init__(self, caller, X=None):
- self.caller = caller # designed to be typeclasses.characters.Character
- self.meta = dict()
- self.X = X
- self.enabled = True
- self.multiple = False
- # This class instance is also designed to be stored on a typeclass attribute handler like so:
- class Character(DefaultObject):
- ...
- def foo(self):
- test = Test(self, X=None)
- self.db.myattr = {}
- self.db.myattr['test'] = test # ERROR
- # With the most recent traceback of:
- # ~/evennia/evennia/utils/picklefield.py in dbsafe_encode(value, compress_object, pickle_protocol)
- # 101 value = pack_dbobj(value)
- # 102
- # --> 103 value = dumps(value, protocol=pickle_protocol)
- # 104
- # 105 if compress_object:
- # TypeError: 'NoneType' object is not callable
- # It turns out that assigning the self.caller to Test breaks the code with the error above.
- # I can't save the self.caller to class which is then stored as an attribute on said caller??
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement