(file, content)
| 5 | |
| 6 | |
| 7 | def update_file(file, content): |
| 8 | try: |
| 9 | with open(file, "r") as fobj: |
| 10 | if fobj.read() == content: |
| 11 | return False |
| 12 | except (OSError, ValueError): |
| 13 | pass |
| 14 | with open(file, "w") as fobj: |
| 15 | fobj.write(content) |
| 16 | return True |
| 17 | |
| 18 | |
| 19 | sre_constants_header = f"""\ |