summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2010-12-03 21:04:21 +0200
committerPearu Peterson <pearu.peterson@gmail.com>2010-12-03 21:05:33 +0200
commite2e265248d2a1f7f71d28e3d6ebebeb8eb597c71 (patch)
treeec2c81fa152fe71a4c192f6e4564f3fc0c345f86
parent6aacc2d373c961865c43f139acbf15d9cb823c04 (diff)
downloadnumpy-e2e265248d2a1f7f71d28e3d6ebebeb8eb597c71.tar.gz
BUG: Fixes ticket 1693.
-rwxr-xr-xnumpy/f2py/crackfortran.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py
index 1858353c5..5e2bb00a3 100755
--- a/numpy/f2py/crackfortran.py
+++ b/numpy/f2py/crackfortran.py
@@ -828,7 +828,9 @@ def analyzeline(m,case,line):
else:
groupcache[groupcounter]['from']='%s:%s'%(groupcache[groupcounter-1]['from'],groupcache[groupcounter-1]['name'])
for k in groupcache[groupcounter].keys():
- if not groupcache[groupcounter][k]: del groupcache[groupcounter][k]
+ if not groupcache[groupcounter][k]:
+ del groupcache[groupcounter][k]
+
groupcache[groupcounter]['args']=args
groupcache[groupcounter]['body']=[]
groupcache[groupcounter]['externals']=[]
@@ -862,6 +864,7 @@ def analyzeline(m,case,line):
if t:
typespec,selector,attr,edecl=cracktypespec0(t.group('this'),t.group('after'))
updatevars(typespec,selector,attr,edecl)
+
if case in ['call','callfun']:
grouplist[groupcounter-1].append(groupcache[groupcounter])
grouplist[groupcounter-1][-1]['body']=grouplist[groupcounter]
@@ -871,6 +874,7 @@ def analyzeline(m,case,line):
grouplist[groupcounter-1][-1]['body']=grouplist[groupcounter]
del grouplist[groupcounter]
groupcounter=groupcounter-1 # end interface
+
elif case=='entry':
name,args,result,bind=_resolvenameargspattern(m.group('after'))
if name is not None:
@@ -923,11 +927,12 @@ def analyzeline(m,case,line):
if _intentcallbackpattern.match(ap):
if k not in groupcache[groupcounter]['args']:
if groupcounter>1:
- outmess('analyzeline: appending intent(callback) %s'\
- ' to %s arguments\n' % (k,groupcache[groupcounter]['name']))
if '__user__' not in groupcache[groupcounter-2]['name']:
outmess('analyzeline: missing __user__ module (could be nothing)\n')
- groupcache[groupcounter]['args'].append(k)
+ if k!=groupcache[groupcounter]['name']: # fixes ticket 1693
+ outmess('analyzeline: appending intent(callback) %s'\
+ ' to %s arguments\n' % (k,groupcache[groupcounter]['name']))
+ groupcache[groupcounter]['args'].append(k)
else:
errmess('analyzeline: intent(callback) %s is ignored' % (k))
else: