diff --git a/src/scripts/pycompare.py b/src/scripts/pycompare.py
index 2add23e6d0964ba5cfa671ca2d16088f6b549bca..0ebeff4eaf0f19458a2a8478d9ba7e67ccf40532 100755
--- a/src/scripts/pycompare.py
+++ b/src/scripts/pycompare.py
@@ -141,6 +141,9 @@ def compare_files(config):
         print("ERROR: {0:s} and {1:s} have different numbers of lines!".format(
             config['fortran_file_name'], config['c_file_name']
         ))
+        if (config['log_html']):
+            print("Different file sizes. No log produced.")
+            config['log_html'] = False
     return mismatch_count
 
 ## \brief Perform the comparison of two file lines.