Skip to content

Commit f805c3e

Browse files
[LNT] NFC: Fix order of globals and locals on exec
Summary: Per https://docs.python.org/3/library/functions.html#exec, the globals parameter comes before the locals one. Since `globals` and `locals` refer to the same object for the call in question, we can remove `locals`, which will cause the globals parameter to be used for both the global and the local variables, thus keeping the same behavior. Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: thopre Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68903 llvm-svn: 374685
1 parent d55bb8c commit f805c3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lnt/tests/nt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,15 +536,15 @@ def execute_test_modules(test_log, test_modules, test_module_variables,
536536
results = []
537537
for name in test_modules:
538538
# First, load the test module file.
539-
locals = globals = {}
539+
globals = {}
540540
test_path = os.path.join(config.test_suite_root, 'LNTBased', name)
541541
# This is where shared code between test modules should go.
542542
sys.path.append(os.path.join(config.test_suite_root, 'LNTBased/lib'))
543543
test_obj_path = os.path.join(basedir, 'LNTBased', name)
544544
module_path = os.path.join(test_path, 'TestModule')
545545
module_file = open(module_path)
546546
try:
547-
exec(module_file, locals, globals)
547+
exec(module_file, globals)
548548
except Exception:
549549
info = traceback.format_exc()
550550
fatal("unable to import test module: %r\n%s" % (

0 commit comments

Comments
 (0)