NON-WORKING python with an older version of the MinGW patch.
[fedora-mingw.git] / python / python-2.5.2-binutils-no-dep.patch
1 diff -ru Python-2.5.2-orig/Lib/ctypes/util.py Python-2.5.2/Lib/ctypes/util.py
2 --- Python-2.5.2-orig/Lib/ctypes/util.py        2007-09-14 16:05:26.000000000 -0400
3 +++ Python-2.5.2/Lib/ctypes/util.py     2008-09-24 17:30:06.000000000 -0400
4 @@ -83,9 +83,14 @@
5              if not f:
6                  return None
7              cmd = "objdump -p -j .dynamic 2>/dev/null " + f
8 -            res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
9 +            try:
10 +                res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
11 +            except:
12 +                res = None
13              if not res:
14 -                return None
15 +                return os.path.basename(f) #  This is good for GLibc, I think,
16 +                                           # and a dep on binutils is big (for
17 +                                           # live CDs).
18              return res.group(1)
19  
20      if (sys.platform.startswith("freebsd")