Source

pygame / config.py

Diff from to

File config.py

         newsetup.write(d.line + '\n')
 
     lines = origsetup.readlines()
-    lines.extend(additional_lines)
+    
+    # overwrite lines which already exist with new ones.
+    new_lines = []
+    for l in lines:
+        addit = 1
+        parts = l.split()
+        for al in additional_lines:
+            aparts = al.split()
+            if aparts and parts:
+                if aparts[0] == parts[0]:
+                    #print ('the same!' + repr(aparts) + repr(parts))
+                    #the same, we should not add the old one.  
+                    #It will be overwritten by the new one.
+                    addit = 0
+        if addit:
+            new_lines.append(l)
+
+    new_lines.extend(additional_lines)
+    lines = new_lines
+
     for line in lines:
         useit = 1
         if not line.startswith('COPYLIB'):
     elif sys.platform == 'darwin':
         print_('Using Darwin configuration...\n')
         import config_darwin as CFG
-        additional_platform_setup = file("Setup_Darwin.in", "r").readlines()
+        additional_platform_setup = open("Setup_Darwin.in", "r").readlines()
     else:
         print_('Using UNIX configuration...\n')
         import config_unix as CFG