Fixed error on changing non-existent property in iupdate
authorDmitriy Morozov <morozov@cs.duke.edu>
Fri, 11 Jan 2008 09:01:17 -0500
changeset 20 1630cf85c7f7
parent 19 c79f89b04676
child 21 5b3579dc7abf
Fixed error on changing non-existent property in iupdate
artemis.py
--- a/artemis.py	Thu Jan 10 02:38:37 2008 -0500
+++ b/artemis.py	Fri Jan 11 09:01:17 2008 -0500
@@ -152,7 +152,10 @@
     # Fix the properties
     properties_text = ''
     for property, value in properties:
-        msg.replace_header(property, value)
+        if property in msg:
+            msg.replace_header(property, value)
+        else:
+            msg.add_header(property, value)
         properties_text += '%s=%s\n' % (property, value)
     mbox[0] = msg