Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f83786d

Browse files
authored
Merge pull request #25217 from charris/backport-25186-25212
BUG: Handle common blocks with kind specifications from modules
2 parents 80ecf9f + dbd96e9 commit f83786d

File tree

10 files changed

+131
-55
lines changed

10 files changed

+131
-55
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
``f2py`` now handles ``common`` blocks which have ``kind`` specifications from modules. This further expands the usability of intrinsics like ``iso_fortran_env`` and ``iso_c_binding``.

numpy/f2py/auxfuncs.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
'isunsigned_long_longarray', 'isunsigned_short',
5151
'isunsigned_shortarray', 'l_and', 'l_not', 'l_or', 'outmess',
5252
'replace', 'show', 'stripcomma', 'throw_error', 'isattr_value',
53-
'deep_merge'
53+
'deep_merge', 'getuseblocks'
5454
]
5555

5656

@@ -937,3 +937,11 @@ def get_f2py_modulename(source):
937937
name = m.group('name')
938938
break
939939
return name
940+
941+
def getuseblocks(pymod):
942+
all_uses = []
943+
for inner in pymod['body']:
944+
for modblock in inner['body']:
945+
if modblock.get('use'):
946+
all_uses.extend([x for x in modblock.get("use").keys() if "__" not in x])
947+
return all_uses

0 commit comments

Comments
 (0)