Source

pygame / config.py

Diff from to

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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.