Merge "Just assign a empty collection instead of copy/clear"

This commit is contained in:
Jenkins 2014-12-10 07:05:25 +00:00 committed by Gerrit Code Review
commit 025fed8bf5

View File

@ -144,8 +144,7 @@ class BaseTask(atom.Atom):
:return: the copied task
"""
c = copy.copy(self)
c._events_listeners = c._events_listeners.copy()
c._events_listeners.clear()
c._events_listeners = collections.defaultdict(list)
if retain_listeners:
for event_name, listeners in six.iteritems(self._events_listeners):
c._events_listeners[event_name] = listeners[:]