[Numpy-svn] r8167 - trunk/numpy/f2py

numpy-svn@scip... numpy-svn@scip...
Sat Feb 20 12:13:57 CST 2010


Author: ptvirtan
Date: 2010-02-20 12:13:57 -0600 (Sat, 20 Feb 2010)
New Revision: 8167

Modified:
   trunk/numpy/f2py/cb_rules.py
   trunk/numpy/f2py/f90mod_rules.py
Log:
3K: f2py: break cyclic imports (which are not allowed on Py3) by moving them to functions

Modified: trunk/numpy/f2py/cb_rules.py
===================================================================
--- trunk/numpy/f2py/cb_rules.py	2010-02-20 18:13:40 UTC (rev 8166)
+++ trunk/numpy/f2py/cb_rules.py	2010-02-20 18:13:57 UTC (rev 8167)
@@ -27,7 +27,6 @@
 show=pprint.pprint
 
 from auxfuncs import *
-import capi_maps
 import cfuncs
 
 ################## Rules for callback function ##############
@@ -415,6 +414,8 @@
 
 def buildcallback(rout,um):
     global cb_map
+    import capi_maps
+
     outmess('\tConstructing call-back function "cb_%s_in_%s"\n'%(rout['name'],um))
     args,depargs=getargs(rout)
     capi_maps.depargs=depargs

Modified: trunk/numpy/f2py/f90mod_rules.py
===================================================================
--- trunk/numpy/f2py/f90mod_rules.py	2010-02-20 18:13:40 UTC (rev 8166)
+++ trunk/numpy/f2py/f90mod_rules.py	2010-02-20 18:13:57 UTC (rev 8167)
@@ -26,7 +26,6 @@
 from auxfuncs import *
 import numpy as np
 import capi_maps
-import rules
 import func2subr
 from crackfortran import undo_rmbadname, undo_rmbadname1
 
@@ -83,6 +82,7 @@
 
 def buildhooks(pymod):
     global fgetdims1,fgetdims2
+    import rules
     ret = {'f90modhooks':[],'initf90modhooks':[],'body':[],
            'need':['F_FUNC','arrayobject.h'],
            'separatorsfor':{'includes0':'\n','includes':'\n'},



More information about the Numpy-svn mailing list