Skip to content

Commit

Permalink
Fix __slots__ error with metaCookie #71
Browse files Browse the repository at this point in the history
  • Loading branch information
craig-sh committed Jul 10, 2018
1 parent e9fc930 commit 03eaac6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/python/mod_python/Cookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ def __new__(cls, clsname, bases, clsdict):
clsdict["_valid_attr"] = _valid_attr
clsdict["__slots__"] = __slots__

return type.__new__(cls, clsname, bases, clsdict)

def __init__(cls, clsname, bases, clsdict):

def set_expires(self, value):

if type(value) == type(""):
Expand All @@ -96,9 +100,7 @@ def set_expires(self, value):
def get_expires(self):
return self._expires

clsdict["expires"] = property(fget=get_expires, fset=set_expires)

return type.__new__(cls, clsname, bases, clsdict)
cls.expires = property(fget=get_expires, fset=set_expires)

# metaclass= workaround, see
# http://mikewatkins.ca/2008/11/29/python-2-and-3-metaclasses/#using-the-metaclass-in-python-2-x-and-3-x
Expand Down

0 comments on commit 03eaac6

Please sign in to comment.