From be874e3c70b16a7f5fc42e7ac79f6259e9327238 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 24 Sep 2013 16:32:30 -0700 Subject: [PATCH] Fix deepcopying JIDs --- sleekxmpp/jid.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sleekxmpp/jid.py b/sleekxmpp/jid.py index 620d4160..ac5ba30d 100644 --- a/sleekxmpp/jid.py +++ b/sleekxmpp/jid.py @@ -19,6 +19,8 @@ import stringprep import threading import encodings.idna +from copy import deepcopy + from sleekxmpp.util import stringprep_profiles from sleekxmpp.thirdparty import OrderedDict @@ -630,3 +632,7 @@ class JID(object): def __copy__(self): """Generate a duplicate JID.""" return JID(self) + + def __deepcopy__(self, memo): + """Generate a duplicate JID.""" + return JID(deepcopy(str(self), memo))