@@ -91,14 +91,14 @@ def main():
91
91
print ("HTML Chunking Example\n ====================\n " )
92
92
93
93
if not os .path .exists (args .html_file ):
94
- print (f "Error: Sample document '{ args . html_file } ' not found." , file = sys .stderr )
94
+ print ("Error: Sample document '%s ' not found." % args . html_file , file = sys .stderr )
95
95
return 1
96
96
97
97
try :
98
98
with open (args .html_file , "r" , encoding = "utf-8" ) as f :
99
99
sample_html = f .read ()
100
100
except IOError as e :
101
- print (f "Error reading HTML file '{ args .html_file } ': { e } " , file = sys .stderr )
101
+ print ("Error reading HTML file '%s': %s" % ( args .html_file , e ) , file = sys .stderr )
102
102
return 1
103
103
104
104
original_tokens = count_html_tokens (sample_html )
@@ -131,12 +131,12 @@ def main():
131
131
try :
132
132
sys .exit (main ())
133
133
except ImportError as e :
134
- print (f "Error: Failed to import a required module." , file = sys .stderr )
135
- print (f "Detail: { e } " , file = sys .stderr )
134
+ print ("Error: Failed to import a required module." , file = sys .stderr )
135
+ print ("Detail: %s" % e , file = sys .stderr )
136
136
print ("\n Suggestion: Try running this script from the project's root directory using 'python -m html_chunking.example'" , file = sys .stderr )
137
137
sys .exit (1 )
138
138
except Exception as e :
139
- print (f "An unexpected error occurred: { e } " , file = sys .stderr )
139
+ print ("An unexpected error occurred: %s" % e , file = sys .stderr )
140
140
import traceback
141
141
traceback .print_exc ()
142
142
sys .exit (1 )
0 commit comments