summaryrefslogtreecommitdiff
path: root/numpy/distutils/fcompiler
diff options
context:
space:
mode:
authorRohit Goswami <rgoswami@quansight.com>2023-01-16 20:21:45 +0530
committerGitHub <noreply@github.com>2023-01-16 15:51:45 +0100
commit6b5cd92675139511b4b24ddfe822e96b03700edb (patch)
tree6dd1fbbc330a171cb30d855f80b3cce142a7ac8c /numpy/distutils/fcompiler
parent4e710c5be093eb4367b4a08d9068f99f9070870d (diff)
downloadnumpy-6b5cd92675139511b4b24ddfe822e96b03700edb.tar.gz
MAINT: `f2py` cleanup (#22885)
Updates the free format handling of .f90 and other common extensions (through a minor re-write). Also removes an unused function. This disallows previously allowed (but highly unlikely to be present) code-paths, namely having fixed form F77 code in a fortran 90 file (with .f90). Co-authored-by: Sebastian Berg <sebastianb@nvidia.com>
Diffstat (limited to 'numpy/distutils/fcompiler')
-rw-r--r--numpy/distutils/fcompiler/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/distutils/fcompiler/__init__.py b/numpy/distutils/fcompiler/__init__.py
index ecba3e5d5..793f0bccf 100644
--- a/numpy/distutils/fcompiler/__init__.py
+++ b/numpy/distutils/fcompiler/__init__.py
@@ -571,7 +571,8 @@ class FCompiler(CCompiler):
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
"""Compile 'src' to product 'obj'."""
src_flags = {}
- if is_f_file(src) and not has_f90_header(src):
+ if Path(src).suffix.lower() in COMMON_FIXED_EXTENSIONS \
+ and not has_f90_header(src):
flavor = ':f77'
compiler = self.compiler_f77
src_flags = get_f77flags(src)