[Numpy-svn] r6157 - branches/numpy-mingw-w64/numpy/distutils

numpy-svn@scip... numpy-svn@scip...
Fri Dec 19 02:44:03 CST 2008


Author: cdavid
Date: 2008-12-19 02:43:56 -0600 (Fri, 19 Dec 2008)
New Revision: 6157

Modified:
   branches/numpy-mingw-w64/numpy/distutils/mingw32ccompiler.py
Log:
Forgot to add the regex for the generate_def function.

Modified: branches/numpy-mingw-w64/numpy/distutils/mingw32ccompiler.py
===================================================================
--- branches/numpy-mingw-w64/numpy/distutils/mingw32ccompiler.py	2008-12-19 08:41:39 UTC (rev 6156)
+++ branches/numpy-mingw-w64/numpy/distutils/mingw32ccompiler.py	2008-12-19 08:43:56 UTC (rev 6157)
@@ -12,6 +12,7 @@
 import sys
 import log
 import subprocess
+import re
 
 # Overwrite certain distutils.ccompiler functions:
 import numpy.distutils.ccompiler
@@ -31,6 +32,10 @@
 from distutils.msvccompiler import get_build_version as get_build_msvc_version
 from numpy.distutils.misc_util import msvc_runtime_library
 
+# Useful to generate table of symbols from a dll
+_START = re.compile(r'\[Ordinal/Name Pointer\] Table')
+_TABLE = re.compile(r'^\s+\[([\s*[0-9]*)\] ([a-zA-Z0-9_]*)')
+
 # the same as cygwin plus some additional parameters
 class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler):
     """ A modified MingW32 compiler compatible with an MSVC built Python.
@@ -224,7 +229,7 @@
     The .def file will be overwritten"""
     dump = dump_table(dll)
     for i in range(len(dump)):
-        if TABLE.match(dump[i]):
+        if _START.match(dump[i]):
             break
 
     if i == len(dump):
@@ -232,7 +237,7 @@
 
     syms = []
     for j in range(i, len(dump)):
-        m = table.match(lines[j])
+        m = _TABLE.match(lines[j])
         if m:
             syms.append((int(m.group(1).strip()), m.group(2)))
         else:



More information about the Numpy-svn mailing list