Commits

Anonymous committed 1f70b79

fixed superfluous comment added when there is no new parameter in the
patch

Comments (0)

Files changed (1)

confpatcher/confpatcher.py

         else:
             print line,
     # add missing configuration options
-    config_file = open(config_file_path, "a")
-    if config_file:
-        config_file.write("\n")
-        config_file.write("#  added configuration options\n")
-        for param_name, value in patch_data.items():
-            config_file.write("%(param_name)s=%(value)s\n"%vars())
-        config_file.close()
+    if patch_data:
+        config_file = open(config_file_path, "a")
+        if config_file:
+            config_file.write("\n")
+            config_file.write("#  added configuration options\n")
+            for param_name, value in patch_data.items():
+                config_file.write("%(param_name)s=%(value)s\n"%vars())
+            config_file.close()
     
 if __name__ == '__main__':
     config_file_name = sys.argv[1]