Untitled
try:
import signal
saved_handler = signal.signal(signal.SIGINT, lambda x, y: print("Finishing filesystem write."))
with open(index_path, 'w', encoding='utf-8') as index_file:
index_file.write(html)
except OSError as e:
print('cannot create file %s %s' % (index_path, e))
return
finally:
signal.signal(signal.SIGINT, saved_handler)