From 94fe01deec9b41ca3bfed3d04efc23ba50dd3cf5 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Wed, 27 Feb 2019 17:48:42 +0100 Subject: [PATCH] rewriter: Sort dict iterations to fix unit tests --- mesonbuild/rewriter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py index f5f8b611c..bd00ff888 100644 --- a/mesonbuild/rewriter.py +++ b/mesonbuild/rewriter.py @@ -427,7 +427,7 @@ class Rewriter: **cdata.user_options } - for key, val in cmd['options'].items(): + for key, val in sorted(cmd['options'].items()): if key not in options: mlog.error('Unknown options', mlog.bold(key), '--> skipping') continue @@ -474,7 +474,7 @@ class Rewriter: # Print kwargs info if cmd['operation'] == 'info': info_data = {} - for key, val in arg_node.kwargs.items(): + for key, val in sorted(arg_node.kwargs.items()): info_data[key] = None if isinstance(val, mparser.ElementaryNode): info_data[key] = val.value @@ -492,7 +492,7 @@ class Rewriter: # Modify the kwargs num_changed = 0 - for key, val in cmd['kwargs'].items(): + for key, val in sorted(cmd['kwargs'].items()): if key not in kwargs_def: mlog.error('Cannot modify unknown kwarg --> skipping', mlog.bold(key)) continue