File: interpnd-generator.patch

package info (click to toggle)
python-scipy 0.10.1%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 42,232 kB
  • sloc: cpp: 224,773; ansic: 103,496; python: 85,210; fortran: 79,130; makefile: 272; sh: 43
file content (40 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 7d1ecbd42db21f0ca50ab23999756c34c1d77723 Mon Sep 17 00:00:00 2001 
From: Pauli Virtanen <pav@iki.fi>
Date: Sun, 4 Mar 2012 01:48:00 +0100
Description: needed so we can regenerate the pyx file

---
 scipy/interpolate/generate_interpnd.py |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

--- a/scipy/interpolate/generate_interpnd.py
+++ b/scipy/interpolate/generate_interpnd.py
@@ -8,21 +8,20 @@
 
 from mako.template import Template
 
-f = open('interpnd.pyx', 'r')
+f = open('interpnd.pyx.in', 'r')
 template = f.read()
 f.close()
 
+# Run templating engine
+f = open('interpnd.pyx', 'w')
+f.write(Template(template).render())
+f.close()
+
 tmp_dir = tempfile.mkdtemp()
 try:
-    # Run templating engine
-    fn = os.path.join(tmp_dir, 'interpnd.pyx')
-    f = open(fn, 'w')
-    f.write(Template(template).render())
-    f.close()
-
     # Run Cython
     dst_fn = os.path.join(tmp_dir, 'interpnd.c')
-    ret = subprocess.call(['cython', '-I', '../..', '-o', dst_fn, fn])
+    ret = subprocess.call(['cython', '-I', '../..', '-o', dst_fn, 'interpnd.pyx'])
     if ret != 0:
         sys.exit(ret)