Patch #1550800: make exec a function.
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index ae810c4..61364a5 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -282,7 +282,7 @@
     def runcode(self, code):
         try:
             self.usr_exc_info = None
-            exec code in self.locals
+            exec(code, self.locals)
         except:
             self.usr_exc_info = sys.exc_info()
             if quitting: