]> code.delx.au - gnu-emacs/commitdiff
(eexecfile): Use the __main__ rather than `emacs' namespace.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 20 Aug 2006 15:53:57 +0000 (15:53 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 20 Aug 2006 15:53:57 +0000 (15:53 +0000)
etc/ChangeLog
etc/emacs.py

index 0d61048a8585897dd7a0641ddc0e549a94f5d462..ec2b017c25c9e679f8e68cd1fd7d1f05f7c02e1d 100644 (file)
@@ -1,3 +1,7 @@
+2006-08-20  Slawomir Nowaczyk  <slawomir.nowaczyk.847@student.lu.se>  (tiny change)
+
+       * emacs.py (eexecfile): Use the __main__ rather than `emacs' namespace.
+
 2006-08-18  Primoz PETERLIN  <primoz.peterlin@mf.uni-lj.si>
 
        * TUTORIAL.sl: Synchronize with TUTORIAL.
index 9538b0b71278b660fa762b641362d040ad9ec1ec..bc6c5bb034d7c25c19354f9c87a8eddfc8e2d757 100644 (file)
@@ -26,13 +26,14 @@ __all__ = ["eexecfile", "args", "complete", "ehelp", "eimport"]
 
 def eexecfile (file):
     """Execute FILE and then remove it.
+    Execute the file within the __main__ namespace.
     If we get an exception, print a traceback with the top frame
-    (oursleves) excluded."""
+    (ourselves) excluded."""
     try:
-       try: execfile (file, globals (), globals ())
-       except:
-           (type, value, tb) = sys.exc_info ()
-           # Lose the stack frame for this location.
+       try: execfile (file, __main__.__dict__)
+       except:
+           (type, value, tb) = sys.exc_info ()
+           # Lose the stack frame for this location.
            tb = tb.tb_next
            if tb is None:      # print_exception won't do it
                print "Traceback (most recent call last):"