diff babel/messages/catalog.py @ 360:36408f068138

Message.clone doesn't return a shallow copy any longer. This fixes a bug with update where flags where shared.
author aronacher
date Tue, 17 Jun 2008 21:55:14 +0000
parents 9acf6b5baa22
children 324e747f0b09
line wrap: on
line diff
--- a/babel/messages/catalog.py
+++ b/babel/messages/catalog.py
@@ -17,6 +17,7 @@
 from datetime import datetime
 from difflib import get_close_matches
 from email import message_from_string
+from copy import copy
 import re
 try:
     set
@@ -104,9 +105,10 @@
         return cmp(self.id, obj.id)
 
     def clone(self):
-        return Message(self.id, self.string, self.locations, self.flags,
-                       self.auto_comments, self.user_comments,
-                       self.previous_id, self.lineno, self.context)
+        return Message(*map(copy, (self.id, self.string, self.locations,
+                                   self.flags, self.auto_comments,
+                                   self.user_comments, self.previous_id,
+                                   self.lineno, self.context)))
 
     def check(self, catalog=None):
         """Run various validation checks on the message.  Some validations
Copyright (C) 2012-2017 Edgewall Software