Skip to content

Instantly share code, notes, and snippets.

@jameshi16
Created March 19, 2019 16:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameshi16/3c161c378c7d486ff365257991d9da42 to your computer and use it in GitHub Desktop.
Save jameshi16/3c161c378c7d486ff365257991d9da42 to your computer and use it in GitHub Desktop.
[Mine-ish] Fuggit v1
import traceback
import os
while True:
try:
import app
break
except BaseException as e:
stack_summary = traceback.extract_tb(e.__traceback__)
frame_summary = stack_summary.pop()
print(frame_summary.filename)
print("Error at: {:d}, removing line...".format(frame_summary.lineno))
new_file = ""
i = 1
with open(frame_summary.filename, 'r') as ai:
while True:
buffer = ai.readline()
if buffer == "":
break
if (i != frame_summary.lineno):
new_file += buffer
i += 1
open(frame_summary.filename, 'w').write(new_file)
@jameshi16
Copy link
Author

Change app to whatever script minus the .py part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment