diff options
| author | Rohit Goswami <rog32@hi.is> | 2022-04-29 05:23:42 +0000 |
|---|---|---|
| committer | Rohit Goswami <rog32@hi.is> | 2022-04-29 05:26:36 +0000 |
| commit | 3c340e2b2813b4e614fc87a9cb563f68976b6cf7 (patch) | |
| tree | 8de19307fb17fb64cdfa60ca9ee53bba567b8431 /numpy/f2py | |
| parent | e0e9c6af715d6aa92c9d952cb04c73bd5464a84f (diff) | |
| download | numpy-3c340e2b2813b4e614fc87a9cb563f68976b6cf7.tar.gz | |
MAINT: handle precision in selected_real_kind
Diffstat (limited to 'numpy/f2py')
| -rwxr-xr-x | numpy/f2py/crackfortran.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py index 971ebe320..db152698e 100755 --- a/numpy/f2py/crackfortran.py +++ b/numpy/f2py/crackfortran.py @@ -2428,13 +2428,17 @@ def get_parameters(vars, global_params={}): elif iscomplex(vars[n]): outmess(f'get_parameters[TODO]: ' f'implement evaluation of complex expression {v}\n') - try: params[n] = eval(v, g_params, params) except Exception as msg: + # Handle _dp for gh-6624 + if real16pattern.search(v): + v = 8 + elif real8pattern.search(v): + v = 4 params[n] = v # Don't report if the parameter is numeric gh-20460 - if not real16pattern.match(v): + if not real16pattern.search(v) and not real8pattern.search(v): outmess('get_parameters: got "%s" on %s\n' % (msg, repr(v))) if isstring(vars[n]) and isinstance(params[n], int): params[n] = chr(params[n]) |
