summaryrefslogtreecommitdiff
blob: c894f821a2aa8f95894a61ea4b08dfae151efb7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
http://tortall.lighthouseapp.com/projects/78676-yasm/tickets/249

--- m4/cython.m4
+++ m4/cython.m4
@@ -2,13 +2,14 @@
 dnl be set before this function is called.
 dnl  CYTHON_CHECK_VERSION([MIN-VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
 AC_DEFUN([CYTHON_CHECK_VERSION],
- [prog="import sys
+ [prog="import re, sys
 from Cython.Compiler.Version import version
 def get_int(arg):
-    try:
-        return int(arg)
-    except ValueError:
+    matched = re.match(r'\d+', arg)
+    if matched is None:
         return 0
+    else:
+        return int(matched.group(0))
 # split strings by '.' and convert to numeric.  Append some zeros
 # because we need at least 4 digits for the hex conversion.
 ver = map(get_int, version.rstrip('abcdefghijklmnopqrstuvwxyz').split('.')) + [[0, 0, 0]]