From 39dbff988d9287c8dd4f1d8001f795e85512e47c Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Wed, 20 Nov 2024 17:28:47 +0000 Subject: [PATCH] Apply formatting --- ford/reader.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ford/reader.py b/ford/reader.py index 47428605..b4bf779f 100755 --- a/ford/reader.py +++ b/ford/reader.py @@ -167,17 +167,21 @@ def __init__( incdirs = [f"-I{d}" for d in self.inc_dirs] print(f"Preprocessing {filename}") preprocessor_command = preprocessor + macros + incdirs + [filename] - if preprocessor_command[0] == 'pcpp': + if preprocessor_command[0] == "pcpp": local_out = StringIO() from pcpp.pcmd import CmdPreprocessor + with redirect_stdout(local_out): - _ = CmdPreprocessor(preprocessor_command) + CmdPreprocessor(preprocessor_command) self.reader = StringIO(local_out.getvalue()) else: - command = ' '.join(preprocessor_command) + command = " ".join(preprocessor_command) try: out = subprocess.run( - preprocessor_command, encoding=encoding, check=True, capture_output=True + preprocessor_command, + encoding=encoding, + check=True, + capture_output=True, ) if out.stderr: warn(