diff options
Diffstat (limited to 'etc/emacs.py')
| -rw-r--r-- | etc/emacs.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/etc/emacs.py b/etc/emacs.py index 9538b0b7127..bc6c5bb034d 100644 --- a/etc/emacs.py +++ b/etc/emacs.py | |||
| @@ -26,13 +26,14 @@ __all__ = ["eexecfile", "args", "complete", "ehelp", "eimport"] | |||
| 26 | 26 | ||
| 27 | def eexecfile (file): | 27 | def eexecfile (file): |
| 28 | """Execute FILE and then remove it. | 28 | """Execute FILE and then remove it. |
| 29 | Execute the file within the __main__ namespace. | ||
| 29 | If we get an exception, print a traceback with the top frame | 30 | If we get an exception, print a traceback with the top frame |
| 30 | (oursleves) excluded.""" | 31 | (ourselves) excluded.""" |
| 31 | try: | 32 | try: |
| 32 | try: execfile (file, globals (), globals ()) | 33 | try: execfile (file, __main__.__dict__) |
| 33 | except: | 34 | except: |
| 34 | (type, value, tb) = sys.exc_info () | 35 | (type, value, tb) = sys.exc_info () |
| 35 | # Lose the stack frame for this location. | 36 | # Lose the stack frame for this location. |
| 36 | tb = tb.tb_next | 37 | tb = tb.tb_next |
| 37 | if tb is None: # print_exception won't do it | 38 | if tb is None: # print_exception won't do it |
| 38 | print "Traceback (most recent call last):" | 39 | print "Traceback (most recent call last):" |