Skip to content

Commit

Permalink
Apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedThree committed Nov 20, 2024
1 parent baca9d9 commit 39dbff9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ford/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 39dbff9

Please sign in to comment.