cleaning up the traceback
This commit is contained in:
parent
9b770853ae
commit
5d54fcd158
@ -3,7 +3,9 @@
|
|||||||
from hy.lang.importer import _hy_import_file
|
from hy.lang.importer import _hy_import_file
|
||||||
|
|
||||||
from code import InteractiveConsole
|
from code import InteractiveConsole
|
||||||
|
import traceback
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import readline
|
import readline
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -11,7 +13,12 @@ except ImportError:
|
|||||||
|
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
sys.argv = sys.argv[1:]
|
sys.argv = sys.argv[1:]
|
||||||
|
try:
|
||||||
mod = _hy_import_file(sys.argv[0], '__main__')
|
mod = _hy_import_file(sys.argv[0], '__main__')
|
||||||
|
except Exception as e:
|
||||||
|
exc_type, exc_value, exc_traceback = sys.exc_info()
|
||||||
|
ntb = exc_traceback.tb_next.tb_next.tb_next # YUCK.
|
||||||
|
raise type(e), None, ntb
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user