[PATCH] D67808: [LNT] Python 3 support: Fix exec syntax

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 01:28:48 PDT 2019


thopre created this revision.
thopre added reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls.
thopre added a parent revision: D67807: [LNT] Python 3 support: Fix except with named exception.

Replace python2-specific exec statements with calls to exec builtins.
This was produced by running futurize's stage1 lib2to3.fixes.fix_exec.


https://reviews.llvm.org/D67808

Files:
  lnt/tests/nt.py


Index: lnt/tests/nt.py
===================================================================
--- lnt/tests/nt.py
+++ lnt/tests/nt.py
@@ -543,7 +543,7 @@
         module_path = os.path.join(test_path, 'TestModule')
         module_file = open(module_path)
         try:
-            exec module_file in locals, globals
+            exec(module_file, locals, globals)
         except Exception:
             info = traceback.format_exc()
             fatal("unable to import test module: %r\n%s" % (


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67808.220966.patch
Type: text/x-patch
Size: 496 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190920/07a7da7a/attachment.bin>


More information about the llvm-commits mailing list