Commits

Oben Sonne committed 4928f1c

Undo [e529749635df] (Py3 hack)

  • Participants
  • Parent commits 48ebcc7

Comments (0)

Files changed (1)

     sys.exit(1)
 
 # =============================================================================
-# Python 2/3 hacks
-# =============================================================================
-
-PY3 = sys.version_info[0] == 3
-
-if PY3:
-    import builtins
-    exec_ = getattr(builtins, "exec")
-else:
-    import tempfile
-    def exec_(code, envdic):
-        with tempfile.NamedTemporaryFile() as tf:
-            tf.write(code)
-            tf.flush()
-            execfile(tf.name, envdic)
-
-# =============================================================================
 # init site
 # =============================================================================
 
         # execute
         sys.stdout = StringIO.StringIO()
         try:
-            exec_(stmt, macros.copy())
+            exec stmt in macros.copy()
         except:
             sys.stdout = sys.__stdout__
             abort_iex(page, "statements", stmt, traceback.format_exc())