diff --git a/atarashi/libs/commentPreprocessor.py b/atarashi/libs/commentPreprocessor.py index 9d8933f1..c2779c16 100644 --- a/atarashi/libs/commentPreprocessor.py +++ b/atarashi/libs/commentPreprocessor.py @@ -124,9 +124,16 @@ def extract(inputFile): with open(outputFile, 'w') as outFile: # if the file extension is supported if fileType in supportedFileExtensions: - data_file = commentExtract(inputFile) - data = licenseComment(data_file) - outFile.write(data) + try: + data_file = commentExtract(inputFile) + data = licenseComment(data_file) + outFile.write(data) + except Exception as e: + #if the nirjas may mis-parse file + with open(inputFile) as inFile: + lines = inFile.read().split('\n') + for line in lines: + outFile.write(line + '\n') else: # if file extension is not supported with open(inputFile) as inFile: