Skip to content

Commit b29c81c

Browse files
committed
bugfix: fix bug of preprocessing parsed files
1 parent 552be3a commit b29c81c

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/main/python/fobis/ParsedFile.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,12 @@ def parse(self, inc=['.INC', '.F', '.FOR', '.FPP', '.F77', '.F90', '.F95', '.F03
341341
preprocessor += ' -C -w '
342342
elif preprocessor == 'fpp':
343343
preprocessor += ' -w '
344-
source = str(check_output(preprocessor + ' ' + preproc + ' ' + '-I'.join(include) + ' ' + self.name, shell=True, stderr=STDOUT, encoding='UTF-8'))
344+
if preproc is None:
345+
preproc = ''
346+
includes = ' '
347+
if len(include) > 0 :
348+
includes = ' -I' + '-I'.join(include) + ' '
349+
source = str(check_output(preprocessor + ' ' + preproc + includes + self.name, shell=True, stderr=STDOUT, encoding='UTF-8'))
345350
source = source.replace('\\n', '\n')
346351
else:
347352
source = str(openReader(self.name).read())
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)